Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text file transfer using commtools
Message
From
11/06/1997 15:36:11
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
09/06/1997 02:40:27
Brad Degroot
Ge Capital It Solutions
Melbourne, Australia
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00035327
Message ID:
00035976
Views:
41
> The mainframe character set isn't ASCII but rather ??EBCDIC??. > Using binary mode transfer would not work unless the two character sets > matched or a translator was written. > It just seems that we could save a lot of heartache if we simply purchased > a file transfer system with the capabilities we require instead of us > having to write a translator. > > Brad C'mon, the translator can be written in fox within one hour. I wrote one in FP1.02 for sake of some data transfer. It simply takes one 256-byte string and a sys(15) function, or two 256-byte strings and a ChrTran() function. Open the source file low-level and read it in portions of, say, 4K or so and write them into another file, like this: in_handle=fopen(source_file) out_handle=fcreate(dest_file) do while !feof(in_handle) buffer=fread(in_handle, 4096) =fwrite(out_handle, chrtran(buffer, ebcd_string, ascii_string) endd close all ascii_string should contain chr(0)+chr(1)+...+chr(255), ebcd_string should contain corresponding characters in EBCDIC, or vice versa.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform