
File Format conversion, ascii freeform -->.csv <-->.wk1<-->dbf<-->?HELP
Quote:
> can go straight through. In brief, depending on what flags are present,
> shorthand entries need to be unrolled, on occasion. I may also have to
> modify the code frequently. I can't quite seem to figure out why I can't
It depends on what exactly the content of these free format lines
is, but...
o If the data does have some structure, then breaking it up into
the pieces that you are interested in is a good idea. Even if
the pieces need further processing, it's often easier to get
them all seperated first, and then process away.
o Sometimes you can use a second file as a sort of description
of what the first file is supposed to contain. Then instead of
changing code, you can change the second file.
Quote:
> malloc() a buffer of size greater than 60K. (I'm using a PC to do this, VisC,
> windows 3.1 to create MS-DOS apps).
> are there any not-too-difficult ways round this?
This may get a better answer in one of the PC newsgroups, but I
haven't found any. Even in Windows, where one can allocate a chunk
larger than 64KB with the OS, the Microsoft library functions
don't seem to want to cross segment boundaries. So if you try and
get the length of a string that sits astride the 64KB mark, the
thing breaks (I encountered this with MSVC 1.5).
Quote:
> Also, I'm writing functions with the policy of always using the return
> keyword for returning true or false, and passing pointers in arguments and using
> strcpy() to copy back the results of string operation to the caller.
> I have the feeling that I'm doing more processing than necessary but I'd like the
> functions I write to be portable, at least to Unix.
I don't think this aids portability, though you may find it helps
how you think about your code, and may be a more defensive style
for you. Note that you can use a pointer value of NULL to indicate
failure from a function that should return a pointer, like fopen()
does.
I think it's mostly a style thing, though overuse of strcpy() is
definitely inefficient. Some people are uncomfortable with passing
pointers to variables to modify them, because of how they think
about indirection.
Quote:
> Josh
--
*** "Radioactivity - It's in the air, for you and for me" - Kraftwerk ***