0

I would like to generate vector names using and put them in a string array, and then I need to call these vector titles in with the readcol command. Here is basically what I want:

vectorname1/vectorname2 are string arrays with the desired names of each vector spreadsheets is a string array of the file names of all of the spreadsheets I want to load in

For I = 0, n do begin

readcol, spreadsheets[I], vectorname1[I], vectorname2[I], format='x,d,x,x,d'

endfor

Plot, vectorname1_1, vectorname2_1

I have tried using the execute command (i.e. execute('readcol,' + spreadsheets[I] + ',' + vectorname1[I] + ',' ...) but IDL returns an error when it encounters the additional quotes in the format keyword.

Any Ideas?

Eric Brown
  • 13,774
  • 7
  • 30
  • 71
  • Welcome to [so]! It would help to clarify your question a bit by formatting code [using Markdown](http://stackoverflow.com/editing-help#code). Also, I think you've forgotten a word in your first sentence (using what?). – sappjw Jul 09 '13 at 15:06
  • It seems like you're also missing some punctuation. Could you try to clarify what the end result is supposed to be? I'm a little confused as to what the larger problem is and I'm not sure this is the best way to go about it. – sappjw Jul 09 '13 at 15:16

1 Answers1

0

Seems like one of your issues is using single quotes within single quotes. Use the single quote mark twice in a row. For example:

retval = execute('print, ''hi''')
sappjw
  • 373
  • 1
  • 14