Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #7008

Re: A problem about programming

From Lino <lino@net.com>
Newsgroups comp.programming
Subject Re: A problem about programming
Date 2016-11-24 14:08 +0100
Organization Aioe.org NNTP Server
Message-ID <mn.c3507e0be7cf3d76.142705@net.com> (permalink)
References <mn.bc7d7e0bef53dd75.142705@Kiss-the-Sphinx> <o1500m$m4q$1@dont-email.me> <mn.bd4e7e0be141a73c.142705@Kiss-the-Sphinx> <o16c26$eqd$1@dont-email.me>

Show all headers | View raw


Richard Heathfield ha usato la sua tastiera per scrivere :


> This AFL solution assumes that "TO:" will only occur once in the string:

> StrReplace(st.Ticker, "TO:", "IT_");

> And that's it! A one-line solution.


NOW it's all Perfect!

AB = CreateObject("Broker.Application");
sts = AB.Stocks();
Qty = sts.Count;


for( i = Qty - 1; i >= 0; i = i - 1 )
{
 st = sts.Item( i );
 Ticker = st.Ticker;
 printf("changing " + Ticker + "\n" );
 Length = StrLen(Ticker );

 if( StrFind(Ticker, "BIT:") )

   st.Ticker= StrReplace(st.Ticker, "BIT:", "IT_");
}

---------------------------------------------

My problem was only in the prefix (first n-chars) delimited with "_" or ":" 
or other special chars.



> But if you are concerned that "TO:" might also occur elsewhere in the 
> string, then StrReplace won't do it, because it replaces all occurrences, 
> not just the first, in which case you'll need to do something like:....

other part of your script (string manipulation) will be useful to me in the 
futures.

THANKS FOR YOUR HELP!!! :)
[I'm sure that I contact you again in the future for other little help about 
scripting :)]

Have a good day!

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

A problem about programming Lino <lino@net.com> - 2016-11-23 19:09 +0100
  Re: A problem about programming Richard Heathfield <rjh@cpax.org.uk> - 2016-11-23 19:36 +0000
    Re: A problem about programming Lino <lino@net.com> - 2016-11-23 21:04 +0100
    Re: A problem about programming Lino <lino@net.com> - 2016-11-23 23:38 +0100
  Re: A problem about programming Richard Heathfield <rjh@cpax.org.uk> - 2016-11-23 21:01 +0000
    Re: A problem about programming Richard Heathfield <rjh@cpax.org.uk> - 2016-11-23 21:02 +0000
    Re: A problem about programming Lino <lino@net.com> - 2016-11-23 22:38 +0100
      Re: A problem about programming Lino <lino@net.com> - 2016-11-23 22:40 +0100
      Re: A problem about programming Richard Heathfield <rjh@cpax.org.uk> - 2016-11-24 09:33 +0000
        Re: A problem about programming Lino <lino@net.com> - 2016-11-24 11:18 +0100
          Re: A problem about programming Lino <lino@net.com> - 2016-11-24 12:49 +0100
            Re: A problem about programming Richard Heathfield <rjh@cpax.org.uk> - 2016-11-24 12:08 +0000
        Re: A problem about programming Lino <lino@net.com> - 2016-11-24 14:08 +0100
        Re: A problem about programming BartC <bc@freeuk.com> - 2016-11-24 17:14 +0000
          Re: A problem about programming Richard Heathfield <rjh@cpax.org.uk> - 2016-11-24 17:18 +0000

csiph-web