next up previous contents
Next: 2.13 fclose Up: 2. General commands Previous: 2.11 expressions

2.12 filenames

Usually, file names are understood as typed, including capital letters. Unix operating systems distinguish between upper and lower case typing !

Additionally (integer) numerical input can be written into the filename. The syntax for this is: "string%dstring",<integer expression>

The file format MUST be enclosed in quotation marks. The position of each integer must be characterised by a "%d". The sequence of strings and "%d"'s can be mixed at will. The corresponding integer expressions must follow after the closing quotation mark. If the command line requires further parameter (like "addfile" for example) they must be given after the format-parameters. The interpretation of the "%d"'s follows the C syntax. Up to 10 numbers can be written into a filename.

Examples:

1)
i[5]=1
outfile a1.1
outfile "a%d.%d",1,1
outfile "a%d.%d",4-3,i[5]
All the above examples will result in the file name "a1.1".

2)
do i[1]=1,11
...
outfile "data%d.calc",i[1]
...
enddo
The output is written to the files "data1.calc" through "data11.calc"

Thomas Proffen {Billinge}
1999-07-20