On Sun, 20 Jun 2021, at 20:03, Jeremy Nicoll wrote:

> I have in the past rather than using just numbered elements of stems eg 
> 
>   thing.1 = "The problem here is"
>   thing.2 = 21
>   thing.3 = 25
> 
> typically defined 
> 
>   _errpfx = 1 ; _xcoord = 2 ; _ycoord = 3 ...

I slightly mis-remembered.  What I actually did was placed in each stem 
that the program used a list of subscript names, eg from the initial 
comment where I noted how I was going to use a "fld." stem: 

/* Create a table containing field data layout information:                     
                     
/*                                                                              
                     
/*   fld.0         - the number of defined fields                               
                     
/*                                                                              
                     
/*   fld.0.1       - list of !xxxx values shared by mainline code and 
functions, eg "!pp !qq !rr !ss"
/*                                                                              
                     
/*   fld.n.!xxxx:  - properties of the n'th defined field, where "xxxx" can be: 
                                                                                
                                     
/*                   !name - before data file is inspected: anticipated name of 
field                
/*                   !minw - before data file is inspected: anticipated minimum 
width                
/*                   !maxw - before data file is inspected: anticipated maximum 
width                
/*                   !strt - in the data file, the starting column              
                     
/*                   !wdth - in the data file, the actual width  

then in the mainline code

fld.    = 0  
fld.0.1 = "!name !minw !maxw !strt !wdth"
do ff = 1 to words(fld.0.1)  /* assign values 1, 2, 3... to vars named in 
"fld.0.1" */
   ffthvnam = word(fld.0.1,ff)
   waste = value(ffthvnam,ff)
end

then in a procedure that uses that stem, the whole stem is exposed, and 
right after that I repeat the same loop as I had in the mainline code.

-- 
Jeremy Nicoll - my opinions are my own.

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

Reply via email to