Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRANFORM giving ***.** as a result
Message
From
19/05/2006 08:28:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
19/05/2006 08:23:13
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01123511
Message ID:
01123520
Views:
20
>>>Got a little routine that creates Excel and comma-delimited variables from the records in a cursor. I'm seeing one of the columns coming out in the results as "***.**" instead of "120.32" though other fields seem fine, regardless of their size. Is it something to do with the TRANSFORM function and the size of the first record's value (which is only "12.34")? Or something?
>>>
>>>
>>>
>>>PROCEDURE p_CreateDownloadFiles
>>>
>>>SCAN
>>>   FOR I = 1 TO FCOUNT()
>>>      m.CommaDelimitedData = m.CommaDelimitedData + '"' + TRANSFORM(EVALUATE(FIELD(I))) + '"' + IIF(I <FCOUNT(), ',', '' )
>>>      m.ExcelData = m.ExcelData + TRANSFORM(EVALUATE(FIELD(I))) + CHR(9)
>>>   NEXT
>>>   m.CommaDelimitedData = m.CommaDelimitedData + TCR_LF
>>>   m.ExcelData = m.ExcelData + TCR_LF
>>>ENDSCAN
>>>
>>>ENDPROC
>>>
>>>
>>
>>Jay,
>>I don't think so nor do I know the answer.
>>My curiosity why are you creating a comma delimited file this way? If you need a text file why are you creating it comma delimited when target is excel. IOW I didn't understand the purpose of this code and you might simply ignore my reply:)
>>Cetin
>
>It's used to satisfy both a comma-delimited and Excel download. We can't simply use COPY and such, as their are headings, etc, as well as the cursors/fields/values can be very different from one to another. Prior to getting to this point the cursors have been converted through XML. It is intended to be as generic as possible, yet allows a fairly strong level of control over the output and layout.

Jay,
Sorry but still I can't understand. You can create a CommaSeperatedValue text file which is comma delimited with headers in first line and excel natively recognizes those files (excel recognizes fox2x,CSV,htm,xml,delimited -with little help- ...).
ie:
use customer
copy to myDelimitedwithHeaders.csv type csv
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform