- How you can declare a continuing value in PICK/World database?
- How you can pass a disagreement to some function by constant reference?
There's some good info within the IBM's manual for World database about constants, but nothing particularly.
Please be aware that:
DEFINE statement value
isn't what i am searching for since it substitutes the statement with value at compile some time and does not provide real constness from the value.
Does anybody understand how to declare individuals?
It's the same statement as with UniData (UniVerse's sister database both of them are with each other known to as U2), that is:
EQU statement TO value
I am unsure of that which you mean by point 2, but I'll provide a search. Automatically, all parameters are 'pass by reference', but there's no type of const argument. It'll still permit you to alter the parameter value internally within the function/subroutine, however the results won't modify the values from the translates in the calling program/function/subroutine.
Side note: If you wish to ensure a subroutine/function doesn't change the need for a real variable you pass (go by value), you may either assign it to some temp variable and pass that, or surround it with parenthesis
CALL MySub(PassByRef, (PassByValue))
exactly what the
() does is create an temporary copy of
PassByValue then pass the temp copy by reference. This stops the alterations propagating back to
I'd make use of the Associate claims to produce constants, and when you need to ask them to open to multiple programs you need to put them in their own individual record and employ the $INCLUDE statement to drag the definitions into other programs. Observe that all the values will be established at compile time.
Regarding "constants" which are established at a while apart from compile time, or not directly referencing values through tags (passing a continuing reference), most U2 developers use control records of some kind. Because the file system and also the programming language in U2 are extremely connected, nobody ever thinks two times relating to this. Most systems I have used have a number of files known as something similar to, "SOMETHING.OR.OTHER.Control" with free-form record structures. The editor can be used to stuff data into records within the control file with secrets that describe the function, like, "INVENTORY.CONSTANTS".
For indirect references, setup the record using the first attribute getting the "constant" names multivalued and also the second area using the "constant" values, also multivalued. Such as this:
INVENTORY.CONSTANTS: 001: JOHN*PAUL*GEORGE*RINGO 001: 100*57*83*19833
(in which the "*" is really something mark).
Then your program would perform the following:
SUBROUTINE SAMPLE(CONSTANT.NAME) . . . OPEN "","SOMETHING.OR.OTHER.CONTROL" TO CTRL.FILE ELSE BOMB READ CONST.REC FROM CTRL.FILE, "INVENTORY.CONTSTANTS" THEN LOCATE CONSTANT.NAME IN CONST.REC<1> SETTING CONST.POS THEN CONST.VALUE = CONST.REC<2,CONST.POS> END ELSE BOMB END END ELSE BOMB END