On 02.07.2024 02:32, Paul Gilmartin wrote:
On Mon, 1 Jul 2024 23:13:04 +0000, Seymour J Metz wrote:

Yes, on my PCs I only use ooRexx, which has DO OVER and USE ARG; in TSO I'm 
stuck with classic REXX, which has neither.

What does DO OVER do for the analogue of REXX:
     A. = 'Preset'
     drop A.GAP
     Null = ''; A.Null = "I dunno"
???

Here an ooRexx program using your stem, tails and drop statement; note: the stem's default value ('PRESET') gets used if referring to stem variables that have no value assigned with the given tail; in ooRexx stems are collections and therefore have also the ability to tell us how many stem variables have been defined so far, we can query the tails (allindexes) in use and have them listed. To demonstrate this

Here the program (hopefully it does not get distorted):

---

parse version v
say "version:" v
say

A. = 'Preset'  /* default tail for uninitialized stem variables */
say "A.:" pp(A.)
A.Paul="Paul Gilmartin"
say "A.NOVALUE:" pp(a.novalue)
say "A.GAP:" pp(A.GAP)
drop A.GAP           /* explicitly drop uninitialized stem variable A.GAP */
say "A.GAP:" pp(A.GAP) "(after 'DROP A.GAP')"
Null = ''
say "Null:" pp(Null) "(empty string)"
A.Null = "I dunno"   /* note tail is the empty string here! */
say "A.Null:" pp(A.Null)
say

say "how many stem variables are set?" pp(a.~items)
say

say "tails in stem A.:"
do counter c tail over A.~allIndexes
   say "tail #" c":" pp(tail) "A.tail:" pp(A.tail)
end
say

say "values (items) stored with a stem variable:"
do counter c item over A.~allItems
   say c": item:" pp(item)
end

::routine pp   /* enclose value in brackets  */
  return "["arg(1)"]"


---

Here its output:

---

version: REXX-ooRexx_5.1.0(MT)_64-bit 6.05 25 Jun 2024

A.: [Preset]
A.NOVALUE: [Preset]
A.GAP: [Preset]
A.GAP: [A.GAP] (after 'DROP A.GAP')
Null: [] (empty string)
A.Null: [I dunno]

how many stem variables are set? [2]

tails in stem A.:
tail # 1: [] A.tail: [I dunno]
tail # 2: [PAUL] A.tail: [Paul Gilmartin]

values (items) stored with a stem variable:
1: item: [I dunno]
2: item: [Paul Gilmartin]

---

HTH

---rony

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to