Define a variable like one array element?
  (6-replies, RPG IV)
Post your reply | Return to Forum  Refresh | ascending | descending
Author: DougCMH Return to Forum  Refresh 2010-02-08 07.00.11
IF you wanted it defined exactly like it...

D  workfield      s                   Like(designOption) 
D                                     dim(%elem(designOption))
Author: Viking Return to Forum  Refresh 2010-02-05 18.50.54
Hmmm... Ok, thanks.  Not sure how I've missed that.
Author: Rocky Return to Forum  Refresh 2010-02-05 18.40.41
The LIKE will define the attributes - in this case that it is 5 Alpha. It does 
not define arrays - IF you wanted to have workfield to be an array you would 
have to add the DIM statment - ie:

D  workfield      s                   Like(designOption) DIM(10)
Author: Viking Return to Forum  Refresh 2010-02-05 18.39.12
T:  Won't that define the workfield as a 10-element array of 5A each, instead 
of just the 5A that I'm after...?
Author: TFisher Return to Forum  Refresh 2010-02-05 18.27.35
D  workfield      s                   Like(designOption)
Author: Viking Return to Forum  Refresh 2010-02-05 17.48.29
Am I not thinking clearly? (quite possible since I've needed a nap all day)

If I have a DS defined (in a prototype copy member) and one of the subfields 
is an array defined like this:

     d  designOption                  5A   Dim(10)

In my program, how can I define a standalone workfield LIKE one element of 
designOption?  In other words I'd like to define a workfield that is 5A (not 
an array), but without hardcoding the 5A, so that if/when designOption is 
redefined at some point in the DS, my workfield will automatically have this 
new definition when I recompile.

Thanks.
Your reply | top | Return to Forum | ascending | descending
      Name:
    
By pressing you agree to the
forum guidelines
      Note: Your message is limited to 3500 characters.