×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

GRIP: Variable named data list and arrays...

GRIP: Variable named data list and arrays...

GRIP: Variable named data list and arrays...

(OP)
Hi folks,
   I'm creating a grip for std notes based on the type of drawing it will be and product line.  All the notes are being pulled from our standard library, with each note in a separate text file.  The file names of the notes are contained in a data list and the routine cycles through the array of note names to pull the notes in and write them to the drawing.  The routine works, but I'm trying to streamline it (it's getting pretty hairy at this point...).
   My problem is that I'm trying to set a string variable equal to the datalist name, and then assign that variable to the name of an array.

...EXISTING CODE SNIPPET...
IFTHEN/r1==5,tfn=dir+OLGbx(x)+'.txt'
 nlist(x)=OLGbx(x)
 d=3   $$ # of notes in datalist, to term loop
ELSEIF/r1==6,tfn=dir+OLPump(x)+'.txt'
 nlist(x)=OLPump(x)
 d=10
ELSEIF/r1==7,tfn=dir+OLLSP(x)+'.txt'
 nlist(x)=OLLSP(x)
 d=10
...
Above is a snippet of my existing code.  I'm trying to set a variable == OLGbx, OLPump, OLLSP, or whatever data list I need to use, and then set an array equal to that variable name for use in the code, something like below (although this code doesn't work obviously...)
...
IFTHEN/ r1==5, ndl='OLGbx'
   d=3
ELSEIF/ r1==6, ndl='OLPump'
   d=10
ELSEIF/ r1==7, ndl='OLLSP'
   d=10
ENDIF
tfn=dir+ndl(x)+'.txt'
nlist(x)=ndl(x)
IF/x==d, done=1
...

Okay....so what am I missing???  Everything from a simple nudge to a smack in the noggin would be appreciated, and of course TIA.  smile

SS

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources