Software Archive
Read-only legacy content
17060 Discussions

unit numbers and array bounds

Intel_C_Intel
Employee
481 Views
If an array is named READ and then is used in an expression, will it search for an input to read?

For example, if units 3,4,5,6,7,8,9,10 and 50 are used to open files, and then an array is used in an expression such as, DREG=READ(0), will the program look for a file with unit 0 to read? could that cause an access violation?

thanks
0 Kudos
1 Reply
Steven_L_Intel1
Employee
481 Views
No. READ is a statement, not a function, and the compiler can distinguish between the two. In your case, READ is assumed to be a user-defined function, unless declared as an array.

You could get an access violation if there is no element 0 of READ, though you should get a bounds error instead if bounds checking is enabled.

Steve
0 Kudos
Reply