next up previous contents
Next: 6.8 Macros Up: 6. FORTRAN style interpreter Previous: 6.6 Conditional statements

   
6.7 Filenames

Usually, file names are understood as typed, including capital letters. Unix operating systems distinguish between upper and lower case typing ! However, sometimes it is required to be able to alter a file name e.g. within a loop. Thus, KUPLOT allows the user to construct file names by writing additional (integer) numerical input 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 characterized 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. All of the following examples will result in the file name 'a1.1':

     i[5]=1
     load xy,a1.1
     load xy,"a%d.%d",1,1
     load xy,"a%d.%d",4-3,i[5]

The second example shows how filenames are changes within a loop. Here the files 'data1.calc' to 'data 11.calc' will be loaded.

     do i[1]=1,11
     ..
     load xy,"data%d.calc",i[1]
     ..
     enddo


next up previous contents
Next: 6.8 Macros Up: 6. FORTRAN style interpreter Previous: 6.6 Conditional statements
Thomas Proffen {Billinge}
1999-06-26