A example of how we use it.
D Pos S 10i 0
D Elements s 100a Dim(100) varying
D SubElem s 100a Dim(100) varying
* Parse the DG1 record into fields
* using #GetTok(). Clear Elements first and reset Pos.
*
/Free
Clear Elements;
Pos = 0;
Elements(*) = #GetTok(Rec:CDelim:Pos);
Pos = 0;
Clear SubElem;
SubElem(*) = #GetTok(Elements(4):CComps:Pos);
On Tue, 2021-10-12 at 13:01 +0000, Kevin Bucknum wrote:
If you aren't where you can get %split, Scott Klements gettok works great. I actually don't have %split anywhere in production yet, but I use gettok a lot.
https://archive.midrange.com/rpg400-l/200408/msg00372.html
On Tue, 2021-10-12 at 14:58 +0200, Dave wrote:
Thanks, nice if you can get %split !
- *Subject*: Re: Getting CGI parameters from QUERY_STRING
- *From*: Kevin Bucknum <Kevin@xxxxxxxxxxxxxxxxxxx>
- *Date*: Tue, 12 Oct 2021 12:06:42 +0000
------------------------------
Pseudo code.
For-Each parmpair in %split(getenv('QUERY_STRING':errords):'&');
// Split parmpair in your favor way.
parmarray = %split(parmpair:'=');
key = parmarray(1);
value = parmarray(2);
\\ do something
End-For
On Tue, 12 Oct 2021 at 10:58, Dave <dfx1@xxxxxxxxxxxxxx<mailto:dfx1@xxxxxxxxxxxxxx><mailto:dfx1@xxxxxxxxxxxxxx<mailto:dfx1@xxxxxxxxxxxxxx>>> wrote:
So, after grappling for a while with QtmhGetEnv and getting it to work
with QUERY_STRING, I discovered that there was GetEnv with CGIDEV2 which
would have been nicer. But there's nothing that will return a list of
parameters and their values? Whyever not?!
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp]
Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550<tel:985-893-2550>
Toll Free: 877-893-2550<tel:877-893-2550>
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp]
Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550<tel:985-893-2550>
Toll Free: 877-893-2550<tel:877-893-2550>
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.