Pete Hall wrote:
Apparently passing a string as an argument to QCMDEXC doesn't work
because EGL doesn't generate code to remove the string length. It can't,
because there is no prototype for the argument, so EGL has no way of
knowing what's needed. Since the maximum EGL string length is 32767, I'm
guessing the length is in the first two bytes at the variable address,
just like the i. I'm not sure if that's because the string uses a double
byte character set, or if it's because the length is signed. I suspect
the former. I also suspect that a literal string is not a string at all,
but rather is stored as an array of char, since it has no need for a
length descriptor. For that reason, a literal can be passed directly to
QCMDEXC without error. However (and I'm really guessing here) passing a
literal value will not work if the argument is expected to be a variable
length string on the i.

What does work when a string value needs to be passed to QCMDEXC, is
assigning the string value to an array of char. This does appear to
remove the string length information. Since QCMDEXC is passed the length
of the command argument, the array can be defined at any arbitrary
length, as long as it is wide enough to contain the value in the command
string. It could probably even be passed the size (in char's) of the
array of char, because the command parser on the i ignores trailing blanks.
By default all strings in EGL are varying length strings. The exception is fixed length strings, which are only found in fixed length records AFAIK. You could have passed the first parameter as a record:

Record CommandRec
10 Command char(64);
end

Then:

myCommand CommandRec
{ Command = "SBMJOB CMD(AR8350 PAYOR(" + payor + "))" };
myCommandLength decimal (15,5) = 64;
call "COMMANDONI" (myCommand, myCommandLen);

Something like that would have worked.

Joe

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].