Manuals list | Manuals list & contents | Table of contents |
1. A General File Interface for Programme INVERSE
1.2 Structure and Philosophy of the General File Interface
1.3 Auxiliary File Interpreter's Functions of the Interface
1.3.1 Controlling the Interface System
1.3.1.2 printfileoperror { <num> }
1.3.1.3 dprintfileoperror { <num> }
1.3.1.4 fwritefileoperror { <num> }
1.3.1.5 writefileoperror { <num> }
1.3.1.6 dwritefileoperror { <num> }
1.3.1.7 clearfileoperrors { }
1.3.1.8 setfileopbuflength { length }
1.4.1 Controlling the State of the Interface
File
1.4.1.2 printfpos { }
1.4.1.3 dprintfpos { }
1.4.1.4 fprintfpart { pos1 <pos2> }
1.4.1.5 printfpart { pos1 <pos2> }
1.4.1.6 dprintfpart { pos1 <pos2> }
1.4.1.7 fwritefpart { pos1 <pos2> }
1.4.1.8 writefpart { pos1 <pos2> }
1.4.1.9 dwritefpart { pos1 <pos2> }
1.4.1.10 fsetpos { pos }
1.4.1.11 fincreasepos { inc }
1.4.1.12 fmarkpos { pos }
1.4.2.2 ffindstringto {to string <pos after> }
1.4.2.3 fskipstring { string <after pos> }
1.4.2.4 fskipstringto { to string <after pos> }
1.4.2.5 fmultfindstring { {string1 string2 string3 string4 ...} <pos after> }
1.4.2.6 fmultfindstringto { to {string1 string2 string3 string4 ...} <pos after> }
1.4.2.7 fmultskipstring { {string1 string2 string3 string4 ...} <after pos> }
1.4.2.8 fmultskipstringto { to {string1 string2 string3 string4 ...} <after pos> }
1.4.2.9 ffindcharacter { charstring <pos> }
1.4.2.10 ffindcharacterto { to charstring <pos> }
1.4.2.11 fskipcharacters { charstring <pos> }
1.4.2.12 fskipcharactersto { to charstring <pos> }
1.4.2.13 ffindblank { <pos> }
1.4.2.14 ffindblankto { to <pos> }
1.4.2.15 fskipblanks { <pos> }
1.4.2.16 fskipblanksto { to <pos> }
1.4.2.17 fnextline { <pos> }
1.4.2.18 ffindbrac { bracstr <pos1 pos2> }
1.4.2.19 ffindbracto { to bracstr <pos1 pos2> }
1.4.2.20 fskipbrac { bracstr <pos1 pos2> }
1.4.2.21 fskipbracto { to bracstr <pos1 pos2> }
1.4.2.22 ffindnumber { < start next val > }
1.4.2.23 ffindnumberto { to < start next val > }
1.4.2.24 fskipnumber { < next start val > }
1.4.2.25 fskipnumberto { to < next start val > }
1.4.3.2 freadnumberto { to varname <start next> }
1.4.3.3 freadscalar { scalspec <start next> }
1.4.3.4 freadscalarto { to scalspec <start next> }
1.4.3.5 freadvector { vecspec <start next> }
1.4.3.6 freadvectorto { to vecspec <start next> }
1.4.3.7 freadmatrix { matspec <start next> }
1.4.3.8 freadmatrixto { to matspec <start next> }
1.5.1 Controlling the State of the Files
1.5.1.2 printfilepos { filespec }
1.5.1.3 dprintfilepos { filespec }
1.5.1.4 fprintfilepart { filespec pos1 <pos2> }
1.5.1.5 printfilepart { filespec pos1 <pos2> }
1.5.1.6 dprintfilepart { filespec pos1 <pos2> }
1.5.1.7 fwritefilepart { filespec pos1 <pos2> }
1.5.1.8 writefilepart { filespec pos1 <pos2> }
1.5.1.9 dwritefilepart { filespec pos1 <pos2> }
1.5.1.10 filesetpos { filespec pos }
1.5.1.11 fileincreasepos { filespec inc }
1.5.1.12 filemarkpos { filespec pos }
1.5.2.2 filefindstringto { filespec to string <pos after> }
1.5.2.3 fileskipstring { filespec string <after pos> }
1.5.2.4 fileskipstringto { filespec to string <after pos> }
1.5.2.5 filemultfindstring { filespec {string1 string2 string3 string4 ...} <pos after> }
1.5.2.6 filemultfindstringto { filespec to {string1 string2 string3 string4 ...} <pos after> }
1.5.2.7 filemultskipstring { filespec {string1 string2 string3 string4 ...} <after pos> }
1.5.2.8 filemultskipstringto { filespec to {string1 string2 string3 string4 ...} <after pos> }
1.5.2.9 filefindcharacter {filespec charstring <pos> }
1.5.2.10 filefindcharacterto { filespec to charstring <pos> }
1.5.2.11 fileskipcharacters { filespec charstring <pos> }
1.5.2.12 fileskipcharactersto { filespec to charstring <pos> }
1.5.2.13 filefindblank { filespec <pos> }
1.5.2.14 filefindblankto { filespec to <pos> }
1.5.2.15 fileskipblanks { filespec file <pos> }
1.5.2.16 fileskipblanksto { filespec to <pos> }
1.5.2.17 filenextline { filespec <pos> }
1.5.2.18 filefindbrac { filespec bracstr <pos1 pos2> }
1.5.2.19 filefindbracto { filespec to bracstr <pos1 pos2> }
1.5.2.20 fileskipbrac { filespec bracstr <pos1 pos2> }
1.5.2.21 fileskipbracto { filespec to bracstr <pos1 pos2> }
1.5.2.22 filefindnumber { filespec < start next val > }
1.5.2.23 filefindnumberto { filespec to < start next val > }
1.5.2.24 fileskipnumber { filespec < next start val > }
1.5.2.25 fileskipnumberto { filespec to < next start
val > }
1.5.3.2 filereadnumberto { filespec to varname <start next> }
1.5.3.3 filereadscalar { filespec scalspec <start next> }
1.5.3.4 filereadscalarto { filespec to scalspec <start next> }
1.5.3.5 filereadvector { filespec vecspec <start next> }
1.5.3.6 filereadvectorto { filespec to vecspec <start next> }
1.5.3.7 filereadmatrix { filespec matspec <start next> }
1.5.3.8 filereadmatrixto { filespec to matspec <start
next> }
1.5.4.2 copyfpart { targetspec pos1 <pos2> }
1.5.4.3 copyfilepart { sourcespec targetspec pos1 <pos2>
}
1.6.1.2 getfpos [ ]
1.6.1.3 getfilepos [ filename, < index1, index2, ... > ]
1.6.1.4 getfeof [ ]
1.6.1.5 getfileeof [ filename, < index1, index2, ... > ]
1.6.1.6 getflength [ ]
1.6.1.7 getfilelength [ filename, < index1, index2, ... > ]
1.6.1.8 fcheckcharacter [ charstr ]
1.6.1.9 filecheckcharacter [ filename, charstr, < index1, index2, ... > ]
1.6.1.10 fcheckstring [ str ]
1.6.1.11 filecheckstring [ filename, str, < index1, index2, ... > ]
1.6.1.12 getfile [ varname spec <index1 index2 ...>
]
Manuals list | Manuals list & contents | Table of contents |
The file interface enables the programme to exchange data with other programmes through text files. Functions of the interface are designed for searching for various items in files, reading various types of data from files and writing data to files in various formats.
Exploiting the functionality of the interface, the programme can work with any simulation programme which uses text files for defining the input data and writing the results. Any piece of data in the text files which are arranged according to some rules can be located, read or replaced by other data using the interface functions. Only some primitive programming skills and some knowledge about the format of the files are necessary to programme any data exchange between the shell and the simulation programme which can possibly be needed during the optimization procedure.
Thanks to the general file interface, a simulation programme and the shell does not have to be integrated to use them together for solving optimization and inverse problems. This is due to the fact that the only contact points between the programmes in the optimization scheme are updating the input data for the simulation according to the current values of the design parameters and reading the results of the simulation which are involved in the value of the objective function and its derivatives.
Nevertheless, the integration is still necessary in the cases where operations which are typically done by the shell can be performed efficiently only using the tools which are possessed by the simulation programme. If this is the case, the shell should have a direct access to specific functions of the simulation programme. In some cases this is possible only when the shell and the programme are properly integrated. The transformation of the input data according to the current values of parameters and the manipulation of the results to evaluate the values of the objective function and its derivatives are operations for which it is often beneficial to use the functionality of the simulation programme.
There is another concerning aspect of using the file interface: the speed. Typically the simulation programmes output large amounts of results. Writing large amounts of results to files and searching for the needed data in such files is time consuming and can be a bottleneck in the optimization procedure. A direct interface makes possible to avoid these operations since the data can be directly transferred between the memory locations at the optimization and simulation part where it normally resides during the programme runtime. Besides, only the needed portions of the data can be transferred.
More sophisticated simulation programmes make possible to precisely
specify which results are to be output to a file. In this case the additional
time needed for data exchange through files is negligible as compared with
the time needed for the simulation. With such programmes the general file
interface can be used almost as efficiently as would be a direct interface.
Manuals list | Manuals list & contents | Table of contents |
The file interpreter's functions of the interface enable searching for specific data in the interface files, reading data from these files, writing data to these files, controlling and influencing the state of these files, and controlling the interface system. The expression evaluator's functions of the interface enable getting information about the interface system and the interface files.
The interpreter's functions which perform searching, reading and controlling the state of the interface files are divided into two groups. The first group of functions perform these operations on the pre-defined file infile, and the other group of analogous functions perform analogous operations on arbitrary files defined during the programme runtime. Such division is introduced because of greater simplicity. The user should not have problems by remembering the names and syntax of both groups of functions because each function from one set has an analogous function with similar name and syntax in the other. Functions from the second group have a sub-string "file" instead of "f" in their names (e.g. filefindstring instead of ffindstring) and have an additional argument - the specification of the file on which they operate. This additional argument is always the first one in the function's argument block and the other arguments are identical.
Functions which read the data, search for different items or write data to files always operate from the current position of the file, so the starting point of the operation does not have to be specified. After the operation is completed, the current position of the file is set to the most logical point according to the kind of operation. For the functions which read or write data such point is after the last read or written byte. There are in general two kinds of functions which search for data items. Functions of the first kind set the current position after a successfully performed operation to the position of the first byte of the found item while the functions of the second kind set the position to the first byte after the found item. There are exceptions to this rule. Functions ffindbrac and filefindbrac which search for closed pairs of brackets set the current position to the first byte after the opening bracket if there are any characters between the opening and the closing bracket, and to the first character after the closing bracket if it follows immediately the opening bracket. Such behaviour is logical because it is expected that the operations on the file which will follow a search for a closed pair of bracket will start inside the bracket pair anything is contained in the brackets, otherwise these operations will start after the brackets. An error code is also recorded if the found brackets contain nothing since this is often an unexpected situation.
The described arrangement simplifies working with the interface and enables the user to use as few intermediate variables as possible. However, in many cases it does not suffice for exchanging data through files. Sometimes we need to jump to arbitrary positions which are somehow connected to operations which were previously performed on a file. A special set of functions was created to enable this by remembering and setting the current position in a specific file. The expression evaluator's functions getfpos and getfilepos return the current position of a file. The file interpreter's functions fmarkpos and filemarkpos assign the current position of a file to the expression evaluator's variable the name of which is specified in the argument block of the corresponding function. The file interpreter's functions fsetpos and filesetpos set the current position of a file to the value specified in the argument block of the corresponding function. Sometimes the functions fincreasepos and fileincreasepos which increase or decrease the file position are more appropriate.
Another mechanism of remembering characteristic positions during the interfacing operations is available. Most of the functions for reading and writing allow the user to call them with additional arguments which specify the names of variables of the expression evaluator to which the characteristic positions of the corresponding operations. For example, in the argument blocks of the functions ffindbrac, fskipbrac, filefindbrac and fieskipbrac the user can optionally specify names of the expression evaluator's variables to which the position of the found opening and closing bracket are assigned, respectively. If only one name is specified, the position of opening bracket is assigned to the appropriate variable.
In general, in functions which search for different items, the user can additionally specify at most two names of expression evaluator's variables for marking characteristic positions. At functions which set the current position in the file to the beginning of the found item, the position of the found item is assigned to the first variable and the position of the first byte after the found item is set to the second variable. It is other way around at the functions which set the position after the found item. Only one instead of two variable names can also be specified. Functions for finding closed pairs of brackets have more specific behaviour (see above). At functions which search for characters only one additional variable name can be specified in their argument blocks (two would not make sense because a character has a constant length 1). The current position after a successfully performed operation is assigned to the corresponding variable.
If the appropriate operations are not performed successfully, unusual values are assigned to variables determined by additional arguments for marking characteristic positions of the operations. Values lesser than 1 which can not represent file positions are usually used for this purpose. Therefore, the user can also test if operations were performed successfully through the values of these auxiliary variables. The same is not valid for functions which perform reading and writing.
At the functions which read data, two additional arguments for marking characteristic file positions of the appropriate operations are allowed in their argument blocks. The current position in the file before the beginning of the operation is assigned to the expression evaluator's variable corresponding to the first additional argument, and the position of the first byte of the last piece of data which was read is assigned to the variable corresponding to the second additional argument.
The functions for searching and reading have the corresponding analogous functions which perform the same operations in a limited range in files. Such analogous functions have similar names with a suffix "to". They also require one additional argument which specifies the end of their range of action (the beginning is determined by the current position in the file, as usual). This is the first argument at functions which operate on the pre-defined file infile and the second at functions which operate on arbitrary files (the file specification is the first argument at such functions).
The general file system has a special way of handling errors. Normally all file interpreter's and expression evaluator's functions of the optimization notify the user about errors by writing error reports to the standard output and to the shell's output file. At the interface we have a specific situation that a failure of an operation may or may not mean an error, dependent on the situation. This is especially expressive at searching operations. Typically, when we search for specific data in a file which contains various data written according to some rules, a lot of failed search operations are performed. This does not indicate that some data is missing, but only gives us additional information which we need in order to locate the data.
Because only true erroneous situations should be reported as errors, there should be a possibility of distinguishing between expected and unexpected failures of operations. A mechanism which enable this is built into the interface system. Failures which do not necessarily mean errors are not reported automatically, but are registered so that they can be examined after the operation is completed. A decision can then be brought whether the failure means an error or not. An error report can then be written only in the case that the failure of the operation means an error, otherwise further actions are undertaken normally. Unexpected situations which are definitely errors are not treated in an usual manner so that error reports are immediately written to the standard output and the output file of the shell.
There are two mechanisms of recording failures which are not automatically reported as errors. File interpreter's functions save their status of success which is a zero integer if the function was performed successfully or a non-zero integer if the function failed in any sense. The programme keeps only one code of success so that it is overwritten by the next executed interface function. The user can obtain the value of this code by the expression evaluator's function fileoperror called without arguments, and so check if the last operation was performed successfully. The file interpreter's functions printfileoperror and fprintfileoperror can be used to print a report about the success status of the last operation of the general file interface. These functions must also be called without arguments to write such report.
Beside keeping in memory the success code of the last performed operation of the general file interface, at all instances of failures the appropriate codes are pushed to a special stack. These codes are the same as the above mentioned success codes, the only difference is that code zero which identifies successful operation is not pushed on the stack. The user can retrieve information about these codes by the same functions as for getting information about the success codes of the last performed operation, only that in this case the error must be specified by the position on the stack of errors.
If the function fileoperror is called by argument 0, the number of errors on the stack is returned. If it is called by a positive number, the appropriate error is returned where the argument identifies the successive number of the error code on the stack. If the argument is negative, its absolute value identifies the successive number of the error on the stack counted backwards. If the value of the argument exceeds the number of errors on the stack, zero is returned.
The meaning of the argument at the functions printfileoperror
and fprintfileoperror is similar, except that when the argument
is zero, a report about all errors is printed, which is also the case if
the argument is greater by absolute value than the number of errors.
Manuals list | Manuals list & contents | Table of contents |
If the function is called without arguments, it prints the report about error status of the last file operation. Each file operation records its error status. This is a code of the last error which occurred during the operation and is not automatically printed to standard output or the shell's output file. These are normally used to indicate situations which don't necessarily mean unexpected behaviour, for example if a string which is searched for in a file is not found. In some situations this can be absolutely normal, therefore the appropriate function of the shell will not automatically report an error, but the user can still check if such situation has occurred, because in some occasions this can mean that something had gone wrong.
Code zero indicates that no error has occurred during this operation. An error status of the next file operation overwrites the error status, but the information about an error is not lost since non-zero error codes are pushed to a stack from which they can be retrieved and appropriate error messages can be printed. This is done by functions printfileoperror and fprintfileoperror when they are called with an argument (num) which specifies a number of error on the stack.
num can be specified in any standard way in which numbers are specified in argument blocks of commands (as a number, as an expression or as a variable in the system of the expression evaluator). If the value of num is zero, error message for all recorded error codes are printed to the output file. If it is a positive number not greater than the number of recorded error codes, a message for the num-th error is printed to the output file (if it is greater than the number of recorded errors, then error messages for all errors are printed). If the value of num is negative an its absolute value is not greater than the number of recorded error codes, then an error message for the num-th error code, counted from the end of the stack, is printed (again a report about all recorded error codes is printed if -num is greater than the number of recorded errors).
All error codes of the file operations can be cleared from the stack by the clearfileoperrors function. The user can so keep trace only about errors which occur from a specific point on.
It is good to know that the number of error codes which are remembered
is limited. When the number of recorded error codes execs a specific pre-defined
value, the first few errors are cleared from the stack.
Manuals list | Manuals list & contents | Table of contents |
If both pos1 and pos2 are specified, they can be zero, and pos2 can be greater than the length of the file. In this case, if pos1 is zero, it is changed to 1, if pos2 is zero, it is changed to the length of the file, and if pos2 is greater than the length of the file, it is also changed to the length of the file before the operation is performed. If only pos1 is specified, it must be greater than zero. If in this case pos1 bytes from the current position would exceed the length of the file, pos1 is reduced before the operation so that the length of the file is matched.
An error is recorded if pos1 or pos2 are invalid. If the
file variable is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file, an appropriate error code is recorded.
If both pos1 and pos2 are specified, they can be zero, and pos2 can be greater than the length of the file. In this case, if pos1 is zero, it is changed to 1, if pos2 is zero, it is changed to the length of the file, and if pos2 is greater than the length of the file, it is also changed to the length of the file before the operation is performed. If only pos1 is specified, it must be greater than zero. If in this case pos1 bytes from the current position would exceed the length of the file, pos1 is reduced before the operation so that the length of the file is matched.
An error is recorded if pos1 or pos2 are invalid. If the
file is not defined, an error report is written to the standard output
and to the programme's output file. If it is not connected to a physical
file, an appropriate error code is recorded.
If it pos is greater than the length of the file, an error is
recorded and the position is set to the end of the file (file length plus
1). If rounded pos is less than zero, an error is recorded and nothing
else happens. If the file is not defined, an error report is written to
the standard output and to the programme's output file. If it is not connected
to a physical file, an appropriate error code is recorded.
If the new position would be less than 1, an error code is recorded and the current position is set to 1. If the new position would be greater than the file length, an error code is recorded and the current position is set to the end of the file (the length of the file plus 1).
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file, an appropriate error code is recorded.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the string is not found, an appropriate error code
is recorded.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the string is not found, an appropriate error code
is recorded.
If argument pos is given, the function assign the position of the found string to the expression evaluator's variable named pos. If after is also given, the function assign the position of the first byte after the found string to the variable with such name.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the string is not found, an appropriate error code
is recorded.
If argument after is given, the function assign the position of the first byte of the found string to the expression evaluator's variable named after, and if pos is also specified, the function assign the position of the found string to the variable with such name.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the string is not found, an appropriate error code
is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the character is not found, an appropriate error code
is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the character is not found, an appropriate error code
is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the character is not found, an appropriate error code
is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the character is not found, an appropriate error code
is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found position is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the next line can not be located (e.g. when the current
position is in the last line of the file), an appropriate error code is
recorded.
Optional arguments pos1 and pos2 specify names of the expression evaluator's variables to which the position of the found opening and closing bracket is assigned. If the search is not successful then a number less than 1 is assigned to those variables.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if a bracket is not found, an appropriate error code is
recorded. An error code is also recorded if a bracket is found but does
not contain any characters, i.e. the closing bracket immediately follow
the opening bracket.
Optional arguments pos1 and pos2 specify names of the expression evaluator's variables to which the position of the found opening and closing bracket is assigned. If the search is not successful then a number less than 1 is assigned to those variables.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if a bracket is not found, an appropriate error code is
recorded.
Optional arguments start, next and val specify names of the expression evaluator's variables to which the position of the found number, the position of the first character after the number, and the value of the number are assigned, respectively. If the search is not successful then integer numbers less than 1 are assigned to start and next.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if a number is not found, an appropriate error code is
recorded.
Optional arguments next, start and val specify names of the expression evaluator's variables to which the position of the first character after the number, the position of the found number, and the value of the number are assigned, respectively. If the search is not successful then integer numbers less than 1 are assigned to next and start.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if a number is not found, an appropriate error code is
recorded.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the number can not be read, an appropriate error code
is recorded.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the scalar can not be read, an appropriate error code
is recorded.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the vector can not be read, an appropriate error code
is recorded. An error code is also recorded if only a part of the vector
can be read.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If the file is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file or if the matrix can not be read, an appropriate error code
is recorded. An error code is also recorded if only a part of the matrix
can be read.
Manuals list | Manuals list & contents | Table of contents |
If both pos1 and pos2 are specified, they can be zero, and pos2 can be greater than the length of the file. In this case, if pos1 is zero, it is changed to 1, if pos2 is zero, it is changed to the length of the file, and if pos2 is greater than the length of the file, it is also changed to the length of the file before the operation is performed. If only pos1 is specified, it must be greater than zero. If in this case pos1 bytes from the current position would exceed the length of the file, pos1 is reduced before the operation so that the length of the file is matched.
An error is recorded if pos1 or pos2 are invalid. If filespec
is not specified or the appropriate file variable is not defined, an error
report is written to the standard output and to the programme's output
file. If it is not connected to a physical file, an appropriate error code
is recorded.
If both pos1 and pos2 are specified, they can be zero, and pos2 can be greater than the length of the file. In this case, if pos1 is zero, it is changed to 1, if pos2 is zero, it is changed to the length of the file, and if pos2 is greater than the length of the file, it is also changed to the length of the file before the operation is performed. If only pos1 is specified, it must be greater than zero. If in this case pos1 bytes from the current position would exceed the length of the file, pos1 is reduced before the operation so that the length of the file is matched.
An error is recorded if pos1 or pos2 are invalid. If filespec
is not specified or the file variable is not defined, an error report is
written to the standard output and to the programme's output file. If it
is not connected to a physical file, an appropriate error code is recorded.
If it pos is greater than the length of the file, an error is
recorded and the position is set to the end of the file (file length plus
1). If rounded pos is less than zero, an error is recorded and nothing
else happens. If fiespec is not specified or the appropriate file
variable is not defined, an error report is written to the standard output
and to the programme's output file. If it is not connected to a physical
file, an appropriate error code is recorded.
If the new position would be less than 1, an error code is recorded and the current position is set to 1. If the new position would be greater than the file length, an error code is recorded and the current position is set to the end of the file (the length of the file plus 1).
If filespec is not specified or the file variable is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file, an appropriate
error code is recorded.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the string
is not found, an appropriate error code is recorded.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the string
is not found, an appropriate error code is recorded.
If argument pos is given, the function assign the position of the found string to the expression evaluator's variable named pos. If after is also given, the function assign the position of the first byte after the found string to the variable with such name.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the string
is not found, an appropriate error code is recorded.
If argument after is given, the function assign the position of the first byte of the found string to the expression evaluator's variable named after, and if pos is also specified, the function assign the position of the found string to the variable with such name.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the string
is not found, an appropriate error code is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the character
is not found, an appropriate error code is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the character
is not found, an appropriate error code is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the character
is not found, an appropriate error code is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found character is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the character
is not found, an appropriate error code is recorded.
Optional argument pos specifies a name of the expression evaluator's variable to which the position of the found position is assigned. If the search is not successful then a number less than 1 is assigned to that variable.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the next line
can not be located (e.g. when the current position is in the last line
of the file), an appropriate error code is recorded.
Optional arguments pos1 and pos2 specify names of the expression evaluator's variables to which the position of the found opening and closing bracket is assigned. If the search is not successful then a number less than 1 is assigned to those variables.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if a bracket
is not found, an appropriate error code is recorded. An error code is also
recorded if a bracket is found but does not contain any characters, i.e.
the closing bracket immediately follow the opening bracket.
Optional arguments pos1 and pos2 specify names of the expression evaluator's variables to which the position of the found opening and closing bracket is assigned. If the search is not successful then a number less than 1 is assigned to those variables.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if a bracket
is not found, an appropriate error code is recorded.
Optional arguments start, next and val specify names of the expression evaluator's variables to which the position of the found number, the position of the first character after the number, and the value of the number are assigned, respectively. If the search is not successful then integer numbers less than 1 are assigned to start and next.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if a number is
not found, an appropriate error code is recorded.
Optional arguments next, start and val specify names of the expression evaluator's variables to which the position of the first character after the number, the position of the found number, and the value of the number are assigned, respectively. If the search is not successful then integer numbers less than 1 are assigned to next and start.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if a number is
not found, an appropriate error code is recorded.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the number
can not be read, an appropriate error code is recorded.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the scalar
can not be read, an appropriate error code is recorded.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the vector
can not be read, an appropriate error code is recorded. An error code is
also recorded if only a part of the vector can be read.
An optional argument start specifies a name of the expression evaluator's variable to which the current position in the file before the operation is assigned, and an optional argument next specifies a name of the expression evaluator's variable to which the position of the first character after the read data is assigned. In the case that no data is read, the position before the operation is also assigned to the variable named next. These values are assigned to the expression evaluator's variables named start and next regardless of the success of the operation, therefore the success can not be examined through the values of these variables, but only through registered errors.
If filespec is not given or the appropriate file is not defined,
an error report is written to the standard output and to the programme's
output file. If it is not connected to a physical file or if the matrix
can not be read, an appropriate error code is recorded. An error code is
also recorded if only a part of the matrix can be read.
An error report is written to the standard output and the programme's
output file if filespec is not specified and if the specified file
variable does not exist or if the corresponding file is not open.
The current position of the file infile remains unchanged while the current position of the file specified by targetspec is set to the first byte after the last copied byte.
If both pos1 and pos2 are specified, they can be zero, and pos2 can be greater than the length of the file. In this case, if pos1 is zero, it is changed to 1, if pos2 is zero, it is changed to the length of the file, and if pos2 is greater than the length of the file, it is also changed to the length of the file before the operation is performed. If only pos1 is specified, it must be greater than zero. If in this case pos1 bytes from the current position would exceed the length of the file, pos1 is reduced before the operation so that the length of the file is matched.
An error is recorded if pos1 or pos2 are invalid. If the
file infile is not defined, an error report is written to the standard
output and to the programme's output file. If it is not connected to a
physical file, an appropriate error code is recorded.
Manuals list | Manuals list & contents | Table of contents |
If the value of argument which is zero, the function evaluates
to the number of recorded errors during file operations. Otherwise, the
function evaluates to a specific error code where which is a successive
number of an error on the stack of errors recorded during file operations.
If the value of which is not integer, its value is rounded to the
nearest integer. If it is negative, its absolute value specifies the successive
number counted backwards (e.g. -1 refers to the last recorded error, -2
refers the pre-last recorded error, etc.).
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.
An error report is written to the standard output and the programme's
output file if the file does not exist.