Passing clipped empty strings to C from 4gl
Posted in 1992
I've just stumbled onto an odd error... anyone else seen this? If you have a C routine, say "foo()", call popvchar(ss, 80), and foo is called from 4gl code via "call foo(s clipped)" where s is an empty char(40) or such -- then ss gets trash in it (mostly spaces but some random chars near [80]). So far I haven't whittled it down to a simplest case, though what I have at the moment is fairly simple. The only non-simple part is that foo actually takes two params, calls popvchar twice, both params same size, both clipped. Both get trashed (one is all spaces, one mostly spaces + random at end). Both do have a null at [79] as if the string passed weren't clipped. All is fine if: (a) remove the 'clipped' from the call (of course the data passed has spaces at the end, which is what I don't want); or (b) pass non-empty strings clipped. Thoughts? I'll deal with tech. support on Monday but thought I might hear something first... -- Andrew Burt aburt@du.edu "And that, my liege, is how we know the Earth to be banana-shaped"