|
Here's the offending code in all its [stripped-down] glory.
h option(*srcstmt : *nounref : *nodebugio )
h dftactgrp(*no) actgrp(*new)
D results s 32767A varying
d ParmsIn ds qualified
d keysAndValues...
d likeds(Pairs) dim(32)
d Pairs ds qualified inz
d Key 32a varying
d Value 32a varying
D*--------------------------------------------------
D* Procedure name: AddUser
D*------------- ------------------------------------
D AddUser...
D pr 512a VARYING
d KVPairs likeds(pairs) dim(20)
*==================================================
* ********* Main logic ***********
*==================================================
* Program Prototype (*Entry parms)
d TEST_1 PR
d TEST_1 PI
/free
ParmsIn.keysAndValues(1).key = 'LastName';
ParmsIn.keysAndValues(2).key = 'Company';
results = AddUser(ParmsIn.keysAndValues);
*inlr = *on;
/end-free
* End Mainline Logic
_____ * Private subprocedures
D*--------------------------------------------------
D* Procedure name: AddUser
D* Purpose: Construct & return the XML string for add_user method.
D*------------- ------------------------------------
P AddUser...
P B
D AddUser...
D pi 512a VARYING
d KVPairs likeds(pairs) dim(20)
* Local fields
d String s 512a varying inz
d x s 3u 0 inz
/free
KVPairs(1).value = 'Moose';
KVPairs(2).value = 'Null & Void, Inc.';
for x = 1 to 32;
select;
when KVPairs(x).key = *blanks; // this is where it breaks
LEAVE;
when KVPairs(x).key = 'LastName';
String = KVPairs(x).value;
when KVPairs(x).key = 'Company';
String += ' of ';
String += KVPairs(x).value;
endsl;
endfor;
Return string;
/end-free
P AddUser...
P E
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.