![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi, again a string question. I am working on a datastring replacing and deleting characters which I dont want but the StrRemove and StrReplace function doesnt work in the following example
D$ = "1, 0" & CRLF & "2, 0" & "3, 0) & CRLF 'spaces after comma intended For i = 0 to StrLength(D$)-1 k = StrAt(D$,i) IF k = " " then 'also ASC(k) = 32 and k = chr(32) dont work StrRemove(D$," ", 1) END IF NEXT (The reason I am using this FOR next loop is that it also checks for TABS and commas but this code is not included here) Now the program passes the IF then condition but doesnt remove (or replace the space with another character). Is this due to the FOR NEXT condition in which the string function is stored and if yes how do I edit a string in a function in which the string itself is examined? Or could it be that a DO WHILE {as long as there are spaces in this string -> remove them} function works better, and if yes how do I state the condition to be fulfilled? I can imagine that after editing, the D$ and i-counter isnt updated in the FOR NEXT loop. thnx again Marc |
|
|||
|
Hi, I don't thing that you can solve the problem by decrementing i, because the end condition for " For - Next " loop remains still the same. I thing, you should use strReplace(D$," ","") for removing spaces ( if I understand correct what do you want ).
Petr |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| String and Shell questions | HARRY | Questions & Help Needed | 4 | 12-18-2007 05:56 PM |
| Remove spaces from string | forisco | Questions & Help Needed | 2 | 11-16-2007 10:07 AM |
| checking textbox string | derez | Questions & Help Needed | 13 | 10-25-2007 11:58 AM |
| Get a input string from user | vinians | Questions & Help Needed | 10 | 09-04-2007 10:43 PM |
| Basic string operators | Rioven | Questions & Help Needed | 2 | 06-10-2007 08:24 AM |