Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorToXML()
Message
From
03/05/2002 10:13:04
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00650814
Message ID:
00652386
Views:
25
No it will not. My actual command changes
"0" with "0."
and
"1" with "1"
See the code below
Strtran(Strtran(test, ["0"], ["0."]), ["1"], ["1."])
>What if you have string '1000' in the XML? It'll be changed to '1.0.0.0.'
>
>>>I normally avoid using Reserved words. The below XML snippet was cut out of a much larger snippet. I am using Win2k SP2 VFP 7.0 SP1 as you are however I got everythinhg working even using reserved words. I am not sure what is going on on yourside.
>>
>>Sorry - it was me. I have put an invalid character in the XML code when editing it. Sorry again for the inconvenience.
>>I made additional tests - if you have numerical fields with only values 0 or 1 VFP parser thinks them as they are logical!
>>
>>Have found a possible workaround - check whether it is appropriate for your problem (the code is a little bit "dirty"):
>>
>>CREATE CURSOR csSettings ( ;
>>Name C(25), ;
>>Value C(10), ;
>>Type C(1), ;
>>Width N(5), ;
>>Precision N(15) ;
>>)
>>Append Blank
>>Replace ;
>>name with "cntGetWorkDirectory", ;
>>value with "", type with "C", ;
>>width with 0, precision with 0
>>Append Blank
>>Replace ;
>>name with "cntGetWorkDirectory", ;
>>value with "", type with "C", ;
>>width with 0, precision with 0
>>
>>CursorToXML(Alias(),'test', 2, 16, 0, "")
>>* the following strtran does the trick:
>>XMLToCursor(Strtran(Strtran(test, ["0"], ["0."]), ["1"], ["1."]), 'test')
>>
>>The trick is to add an extra decimal point after the single 0s and 1s.
>>
>>HTH
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Previous
Reply
Map
View

Click here to load this message in the networking platform