Class FileStatementStaticSemantics
MS-VBAL §5.4.5 the file statements (static semantics), and the Name statement that sits beside them
(RD-VBAL §5.4.5.13).
public static class FileStatementStaticSemantics
- Inheritance
-
FileStatementStaticSemantics
- Inherited Members
Remarks
What each statement's operands have to be declared as:
| Operand | Rule |
|---|---|
a file number (§5.4.5.1.1), a Seek position, a Lock or Unlock record number, a Width line width, a Spc or Tab number | a scalar declared type: any but an array or a user-defined type. |
the path name of an Open, and the record length of its Len clause | Let-coercible to String, and to Integer. |
the Access of an Open | the ones its For mode allows (§5.4.5.1). |
the variable of a Line Input # | a variable, declared as a String or a Variant (§5.4.5.6). |
each variable of an Input #, and the variable of a Get | a variable, not declared as an Object or a class (§5.4.5.10, §5.4.5.12); nor, for Get, as a user-defined type
that has one in it. |
the data of a Put | not declared as an Object, a class, or a user-defined type that has one in it (§5.4.5.11). |
both operands of a Name | Let-coercible to String. |
Methods
TryEvaluate(StaticEvaluationContext, StatementNode, out ImmutableArray<VBCompileErrorInfo>)
Evaluates the operands of a file statement and checks them.
public static bool TryEvaluate(StaticEvaluationContext context, StatementNode statement, out ImmutableArray<VBCompileErrorInfo> errors)
Parameters
contextStaticEvaluationContextThe compile-time context the statement is evaluated in.
statementStatementNodeThe statement.
errorsImmutableArray<VBCompileErrorInfo>Every error found, in operand order. Empty when the statement is valid.