Warning: session_start() [function.session-start]: open(C:\WINDOWS\TEMP\\sess_402550c0da4ac64088b19a9391c54e1f, O_RDWR) failed: No space left on device (28) in C:\dBaseWebNews\newsgroups.php on line 23

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\dBaseWebNews\newsgroups.php:23) in C:\dBaseWebNews\newsgroups.php on line 23

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\dBaseWebNews\newsgroups.php:23) in C:\dBaseWebNews\newsgroups.php on line 23
Web-News v.1.6.2
Subject Re: strip_chars function in a loop
From Charlie <tm@tc.com>
Date Wed, 01 May 2024 17:15:52 -0400
Newsgroups dbase.getting-started

Thanks Mervyn.   works great.  I never got strip_specials, you gave me an example of strip_chars which i am using as a function.  

I never did much with scan, but it works well.  probably will use it a lot more from now on!

Thanks again!

Mervyn Bick Wrote:

> On 2024/05/01 16:49, Charlie wrote:
> > Hey Mervyn..  I am trying to use your function in a loop on a field called mintage which has large numbers with commas.  It is a character field with numbers.   I am trying to eliminate the commas after successfully appending into a new table.  Everything works fine as far as appending the field, but when I try to loop it this way it just replaces with the same chatacter all the way through.  Here is some code of things I've tried.  The function is the same except I changed the cToStrip = ",".  possibly that is the problem.  Any ideas on this?  Here is my code:
> >
> > use csvconv.dbf
> >         append from collection.dbf for csvt = true
> >         go top
> >         //do while not eof()
> >            //msgbox( ""+ '"'+trim(mintage)+'"' )
> >        //cStr = '"'+trim(mintage)+'"'
> >                 cStr = mintage
> >                 cNewStr = strip_chars(cStr)
> >                 replace mintage with cNewStr
> >         //        skip
> >         //enddo
> >         use
> >
> > As you can see I have tried different combinations.  Thanks for any help!
>
> The function strip_chars was in the program strip_specials.prg.  It was
> created specifically to strip & and # from some text.  The code was
> written so that if you wanted to strip & or # you only had to provide a
> single parameter namely the string to be manipulated.  To make the code
> a bit more universal provision was, however made for a second parameter
> to be passed if you ever wanted to strip something other than & or #.
> You do, however, need to pass that second parameter.
>
> I'm assuming that you have strip_specials.prg in the folder you are
> working in.  If not, add a path to strip_specials.prg in the code below.
>
> Seeing that you are working in XDML, keep in mind that you can use
> scan...endscan instead of a do loop with skip to loop through the table.
>   Makes life simpler. :-)
>
> use csvconv.dbf
> append from collection.dbf for csvt = true
> go top
> set procedure to strip_specials.prg // Add the path if necessary.
> scan
>    replace mintage with strip_chars(mintage,",")
> endscan
> use
>
> Mervyn.
>
>



Warning: Unknown: open(C:\WINDOWS\TEMP\\sess_402550c0da4ac64088b19a9391c54e1f, O_RDWR) failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0