Skip to content
Permalink
Browse files

Add files via upload

  • Loading branch information...
cfburns committed May 11, 2019
1 parent ae0947f commit 62b062bdaf686480161b33f29fd3bbc23de8560b
@@ -2,7 +2,7 @@
* *
* Inuendo 1.2 (Alpha release) - CLASS MAINTENANCE *
* *
* Copyright (C) 2012, 2017 Christopher F. Burns Sr. *
* Copyright (C) 2012, 2019 Christopher F. Burns Sr. *
* c/o The Inuendo Project (http://inuendo.us). *
* *
* This program is free software: you can redistribute it and/or modify *
@@ -0,0 +1,157 @@
**********************************************************************************************
* *
* Inuendo 1.2 (Alpha release) - STANDARD 5250 UTILITIES *
* *
* Copyright (C) 2012, 2019 Christopher F. Burns Sr. *
* c/o The Inuendo Project (http://inuendo.us). *
* *
* Use RPG /COPY statement in application programs to include this member. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
**********************************************************************************************

/copy qcpysrc,stdhsrvpgm // ctl specs for srvpgm
/copy qcpysrc,stdentinp // entity input funcs

**********************************************************************************************
* POP-UP WINDOW PROMPTS FOR VARIOUS DATA TYPES.
**********************************************************************************************

dcl-proc PromptDate export; // prompt for date

dcl-pi PromptDate like(EntDateI.Value); // prompt for date
PromptText like(EntNoteI.Value) const; // text for prompt
Required like(EntFlagI.Value) const options(*nopass); // required entry
DftValue like(EntDateI.Value) const options(*nopass); // default value
end-pi; // prompt for date

dcl-f std5250utl workstn include(PromptDate); // pop-up window
dcl-ds PromptDateX likerec(PromptDate:*all) inz; // pop-up record

PromptDateX.DateTxt = PromptText; // text for prompt
PromptDateX.DateTxt = %scanrpl(' ' : ' .' : PromptDateX.DateTxt :
1 + %len(%trim(PromptDateX.DateTxt))); // add dotted line

if %parms >= 3; // if default value
PromptDateX.DateVal = DftValue; // show in window
endif; // if default value

dou PromptDateX.DateVal <> *loval or
(%parms >= 3 and Required = 'N'); // until valid date
exfmt PromptDate PromptDateX; // show pop-up window
evalr PromptDateX.DateErr = 'REQUIRED'; // text for 2nd pop
enddo; // until valid date

return PromptDateX.DateVal; // user specified value

end-proc; // prompt for date

**********************************************************************************************

dcl-proc PromptFlag export; // prompt for flag

dcl-pi PromptFlag like(EntFlagI.Value); // prompt for flag
PromptText like(EntNoteI.Value) const; // text for prompt
Required like(EntFlagI.Value) const options(*nopass); // required entry
DftValue like(EntFlagI.Value) const options(*nopass); // default value
end-pi; // prompt for flag

dcl-f std5250utl workstn include(PromptFlag); // pop-up window
dcl-ds PromptFlagX likerec(PromptFlag:*all) inz; // pop-up record

PromptFlagX.FlagTxt = PromptText; // text for prompt
PromptFlagX.FlagTxt = %scanrpl(' ' : ' .' : PromptFlagX.FlagTxt :
1 + %len(%trim(PromptFlagX.FlagTxt))); // add dotted line

if %parms >= 3; // if default value
PromptFlagX.FlagVal = DftValue; // show in window
endif; // if default value

dou PromptFlagX.FlagVal <> *blank or
(%parms >= 3 and Required = 'N'); // until valid flag
exfmt PromptFlag PromptFlagX; // show pop-up window
evalr PromptFlagX.FlagErr = 'REQUIRED'; // text for 2nd pop
enddo; // until valid flag

return PromptFlagX.FlagVal; // user specified value

end-proc; // prompt for flag

**********************************************************************************************

dcl-proc PromptNote export; // prompt for note

dcl-pi PromptNote like(EntNoteI.Value); // prompt for note
PromptText like(EntNoteI.Value) const; // text for prompt
Required like(EntFlagI.Value) const options(*nopass); // required entry
DftValue like(EntNoteI.Value) const options(*nopass); // default value
end-pi; // prompt for note

dcl-f std5250utl workstn include(PromptNote); // pop-up window
dcl-ds PromptNoteX likerec(PromptNote:*all) inz; // pop-up record

dcl-s Note4Lin char(254) based(nPtr); // four lines combined
dcl-s nPtr pointer inz(%addr(PromptNoteX.NoteVal1)); // ..starts at 1st line

PromptNoteX.NoteTxt = PromptText; // text for prompt
PromptNoteX.NoteTxt = %scanrpl(' ' : ' .' : PromptNoteX.NoteTxt :
1 + %len(%trim(PromptNoteX.NoteTxt))); // add dotted line

if %parms >= 3; // if default value
Note4Lin = DftValue; // show in window
endif; // if default value

dou Note4Lin <> *blank or
(%parms >= 3 and Required = 'N'); // until valid note
exfmt PromptNote PromptNoteX; // show pop-up window
evalr PromptNoteX.NoteErr = 'REQUIRED'; // text for 2nd pop
enddo; // until valid note

return Note4Lin; // four lines combined

end-proc; // prompt for note

**********************************************************************************************

dcl-proc PromptNumb export; // prompt for number

dcl-pi PromptNumb like(EntNumbI.Value); // prompt for number
PromptText like(EntNoteI.Value) const; // text for prompt
Required like(EntFlagI.Value) const options(*nopass); // required entry
DftValue like(EntNumbI.Value) const options(*nopass); // default value
end-pi; // prompt for number

dcl-f std5250utl workstn include(PromptNumb); // pop-up window
dcl-ds PromptNumbX likerec(PromptNumb:*all) inz; // pop-up record

PromptNumbX.NumbTxt = PromptText; // text for prompt
PromptNumbX.NumbTxt = %scanrpl(' ' : ' .' : PromptNumbX.NumbTxt :
1 + %len(%trim(PromptNumbX.NumbTxt))); // add dotted line

if %parms >= 3; // if default value
PromptNumbX.NumbVal = DftValue; // show in window
endif; // if default value

dou PromptNumbX.NumbVal <> 0 or
(%parms >= 3 and Required = 'N'); // until valid number
exfmt PromptNumb PromptNumbX; // show pop-up window
evalr PromptNumbX.NumbErr = 'REQUIRED'; // text for 2nd pop
enddo; // until valid number

return PromptNumbX.NumbVal; // user specified value

end-proc; // prompt for number

**********************************************************************************************
@@ -2,7 +2,7 @@
* *
* Inuendo 1.2 (Alpha release) - STANDARD CRYPTOGRAPHY FUNCTIONS *
* *
* Copyright (C) 2012, 2017 Christopher F. Burns Sr. *
* Copyright (C) 2012, 2019 Christopher F. Burns Sr. *
* c/o The Inuendo Project (http://inuendo.us). *
* *
* This program is free software: you can redistribute it and/or modify *
@@ -2,7 +2,7 @@
* *
* Inuendo 1.2 (Alpha release) - STANDARD ENTITY AGGREGATE FUNCTIONS *
* *
* Copyright (C) 2012, 2017 Christopher F. Burns Sr. *
* Copyright (C) 2012, 2019 Christopher F. Burns Sr. *
* c/o The Inuendo Project (http://inuendo.us). *
* *
* Use RPG /COPY statement in application programs to include this member. *
@@ -2,7 +2,7 @@
* *
* Inuendo 1.2 - STANDARD ENTITY GROUP FUNCTIONS (PROCEDURES) *
* *
* Copyright (C) 2012, 2017 Christopher F. Burns Sr. *
* Copyright (C) 2012, 2019 Christopher F. Burns Sr. *
* c/o The Inuendo Project (http://inuendo.us). *
* *
* This program is free software: you can redistribute it and/or modify *
@@ -998,3 +998,67 @@
end-proc; // entity group by datx


**********************************************************************************************
* FUNCTIONS BASED ON LINK PROPERTIES
**********************************************************************************************

// single value, with moment parameter

dcl-proc EntityGroupLink export; // entity group by link

dcl-pi EntityGroupLink; // entity group by link
ParentID like(EntHeadG.ParentID) const; // parent entity ID
Class like(EntHeadG.Class) const; // entity class
Property like(EntHeadG.Descriptor) const; // property name/path
Value like(EntLinkG.Value) const; // single value
Moment like(EntLinkG.ChangeTime) const options(*nopass); // moment in time
end-pi; // entity group by link

dcl-s SQLStatement varchar(512); // SQL statement
dcl-s RangeLowX like(EntNumxG.Value); // value range low
dcl-s RangeHighX like(EntNumxG.Value); // value range high
dcl-s MomentX like(EntHeadG.CreateTime); // moment in time

monitor; // catch all errors

if %parms >= 5; // if moment provided
MomentX = Moment; // use it
else; // no moment provided
MomentX = getSessionMoment(); // use session moment
endif; // if moment provided

// headers for any relevant entities with matching link property value.

exec sql declare EntityGroupLinkC1 cursor for
select * from enthead
where parentID = :ParentID
and class = :Class
and createtime <= :MomentX
and getLink(entityID, :Property, :MomentX) = :Value
order by entityid; // entities w/match

exec sql open EntityGroupLinkC1; // open cursor

on-error *all; // on any error

endmon; // catch all errors

end-proc; // entity group by link

**********************************************************************************************

// single value, no moment parameter

dcl-proc EntityGroupLinkValue export; // entity group by link

dcl-pi EntityGroupLinkValue; // entity group by link
ParentID like(EntHeadG.ParentID) const; // parent entity ID
Class like(EntHeadG.Class) const; // entity class
Property like(EntHeadG.Descriptor) const; // property name/path
Value like(EntLinkG.Value) const; // comparison value
end-pi; // entity group by link

EntityGroupLink(ParentID : Class : Property : Value); // pass op-descriptor

end-proc; // entity group by link

@@ -2,7 +2,7 @@
* *
* Inuendo 1.2 (Alpha release) - STANDARD ENTITY INPUT FUNCTIONS *
* *
* Copyright (C) 2012, 2017 Christopher F. Burns Sr. *
* Copyright (C) 2012, 2019 Christopher F. Burns Sr. *
* c/o The Inuendo Project (http://inuendo.us). *
* *
* This program is free software: you can redistribute it and/or modify *

0 comments on commit 62b062b

Please sign in to comment.
You can’t perform that action at this time.