|
I have a few RPG programs that are processing programs for CMD interfaces.
Some have the option to send multiple values. I've always just defined the
parameter as a data structure with a binary value to hold the "count" of
options.. For example:
PARM KWD(NAME) TYPE(*CHAR) LEN(60) MIN(1) +
MAX(10) CASE(*MIXED) PROMPT('Name')
dcl-ds NameDSDef Qualified;
NumName Bindec(4) Pos(1);
Name char(60) dim(10); //*NONE
end-ds;
The the parameter is defined as:
NameList likeds(NameDSDef);
This filles the Name.Name array as it should.
But now I have parameters that have multiple parts to them and it's not
working quite the same way.
PARM KWD(ADDRESS) TYPE(ADDDEF) MIN(1) +
MAX(10) PROMPT('Address')
ADDDEF: ELEM TYPE(*CHAR) LEN(100) CASE(*MIXED) +
PROMPT('Address')
ELEM TYPE(*CHAR) LEN(2) +
PROMPT('State')
dcl-ds AddressDSDef Qualified;
NumAddress Bindec(4) Pos(1);
Address char(100) dim(10);
State char(2) dim(10);
end-ds;
Then the parameter is defined as:
AddressList likeds(AddressDSDef);
This seems to add more data in the front, not just the count.
Let's say there are 3 items in the list.... The string appears to be
count, offset to item 3, offset to item 2, offset to item 1, x'0003', then
the data.... etc...
So before each data item is x'0003' and the offsets appear to be the offset
AFTER the count value.
I've been searching for some sort of documentation or examples for this,
but I've come up short. AI is pretty useless when it comes to this.
I'm sure I'm doing something wrong, but I can't find any docs or examples.
It's been years since I've done commands and yes, this has to be a
command. :)
Thanks!
Bradley V. Stone
www.bvstools.com
Native IBM i e-Mail solutions for Microsoft Office 365, Gmail, or any Cloud
Provider!
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.