pick

empty string in open statement in d3 pick


I have the following statement in d3 pick:

OPEN '','AT-MASTER' TO AT.MASTER ELSE RETURN

The examples I have seen of the open statement either completely omit the comma and the thing before it, or they have something inside the thing before the comma, as follows, where dict is inside the single quotes before the comma.

open 'dict','invoice' to invoice.dict then
    print 'ok'
end else
    stop 201,'dict invoice cannot be opened'
end

What does the empty string made with single quotes that appears directly after the OPEN mean?


Solution

  • In old-style BASIC the syntax for OPEN 'DICT','FILENAME' was fixed. The empty first parameter means the Data file is being opened, not the Dictionary. Many developers still default to that syntax. Since the late 80's if only one parameter is present and it has only one word, it's assumed to mean the Data file. And all platforms these days support OPEN 'DICT FILENAME' in a single parameter. So the syntax with '','Datafile' is archaic but still works.