From: Raffaele V. <raf...@un...> - 2024-01-07 18:05:07
|
On 07/01/24 01:01, Nasser M. Abbasi wrote: > > in my script if I do > > ------------ > in "B.red"; > ------------ > > It works. Where B.red is file in same folder. > > But if I do > > ----------- > file_name := "B.red"; > in file_name; > ------------- > > It gives error > > +++ Error file could not be opened: "file_name" > > It looks like "in", "out" and "shut" commands want literal arguments. > But this is very limiting for me, as I need to pass the names of > the files to process in variables and not hard code the file names, > as I have 100's of files that I need to put in a list > and loop over. > > Is there a way around this? Years ago I had a similar problem, and somebody told me the following trick: file_name := "B.red"; in <<file_name>>; that works fine, if you do not need something more sophisticated. In essence, the string gets evaluated from the code block << ... >>. Raf -- |