Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing unprintable characters in character and memo f
Message
From
07/12/2004 14:48:56
 
 
To
06/12/2004 13:51:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00967248
Message ID:
00967563
Views:
10
>Claude,
>
>A. When you scan the table, call a function to perform number 2 with each field of your array. That should execute faster than scanning the table for each field.

I an not sure whow to do this for several fields on one record. Can you please post some sameple code, i.e. how do I get each value, fix it, replace it if is different?


>
>B.
DO WHILE OCCURS(SPACE(2), lcString)
>   lcString = STRTRAN(lcString, SPACE(2), SPACE(1), 1)
>ENDDO
Since SPACE(1) and SPACE(2) are used multiple times would it be more efficent to define variables and if so should I prefix them with "m."?


>C. It should unless the memo field exceeds the length that your version of VFP can handle as a string.
>
>HTH,
>
>>I need to remove unprintable characters from existing tables. My approch is to
>>
>>1. use AFIELDS function to find character and memo fields in a table
>>2. For character field SCAN the table for each character field
>> a. use CHRTRAN functuin to eliminate unprintable characters
>> b. find lenght of new and old strings
>> i. if lengths are diffrent replace old value with new one
>>
>>My Questions
>>
>>A. Is there a more efficent method of doining this?
>>B. How can I remove multiple spaces so that there is only 1 space between text?
>>C. Will this work for memo fields?
>>
>>Eventual goal is to a form where user picks the table to be fixed so that paths will be set. For testing I am writing this as a program.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform