Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Lino Newsgroups: comp.programming Subject: Re: A problem about programming Date: Thu, 24 Nov 2016 14:08:15 +0100 Organization: Aioe.org NNTP Server Lines: 48 Message-ID: References: NNTP-Posting-Host: hPlHszvYrE9msYmsjUlyaw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUCAgI2MiZAsvKk1/Dxz pLx1Jrx3KTy57Tz9cfb7fPo8vPx9vP2+PP4+PP///8AAABAWc5lAAAAB3RJTUUH0wsIEyMtDwzr4gA AAd5JREFUeJx11Dtu20AQBuBf8VJaAyaREwgCTyCAF1gDq56F1zUrqmVHlyzZBq58BHVJm8p10qi3F 2AuwDNkZh8yKdoLCBLm4w5n9iGMPABk43yAPgP6vu+yBQxrI5dCsDIPiqDHNSQPWksnPu8qwGAUVg7 6joqQISeBpkRdPxkB/glKNINteMcCEKtSDqgZ/6a+i32IxycwdJIrIxhoIXyF4BAF0Uueizzfha4oG TqJjhNSOM8RgPJ0PIXTfaP4bozrIPlhSGI3YZcFGJqGypG4vSl4Qp5H2DRo21bidFMU+TSVh83d6dl DdoGWR5P+/uFgN16B/fniILvA+siQnv/cFnu4HiLUdX1sU/v6UmB/OQxUbbWuiNLz31NRLKGy6RuVl U0gKZOyrnG2BPtrwDpL7fvpOa6ey2SQlELB2vdf8Uj6bdSCZiQEFmYKQgsBcZ9aezbldgqK4lCWWjP lx0nkk6WVUJkQ9ISaAZho6ynnHHjQBGjMAAHcl5pU5SLK8xLi+BL0NVAPnwFwMBU+AaESU1fCFYF4D UZu7wBDGwLxnc/39mNJDpuO4NhAxrsWAEjMIx2H9ileqbjs+gvQiqGCh5iKF0sdSsBd8/Dn4beeIio cJLJLuS4Q+uKQ+/kf+4Ng9WQ79vEAAAAASUVORK5CYII= X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: MesNews/1.08.06.00-it Xref: csiph.com comp.programming:7008 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!