5.4.3.7 RSet Statement
Note
This section describes the implementation of MS-VBAL §5.4.3.7 RSet Statement.
RSet (MS-VBAL §5.4.3.7) and LSet
(MS-VBAL §5.4.3.6 LSet Statement;
RD-VBAL §5.4.3.6 LSet Statement) are implemented.
Syntax
| AST node | Instruction kind(s) | Notes |
|---|---|---|
AssignmentStatementNode (Kind: RSet) |
Simple |
The same node shape as Let, Set and LSet. |
See RD-VBAL §3.4.2 Simple Statements.
Runtime Semantics
RSet fits a value into the width the target already has, like LSet, but right-aligned. It takes the target's
width from the target's current value, not from its declared type. Taking the width from the current value makes
RSet meaningful on a variable-length String, and harmless on one.
RSet and LSet differ only in which end pads, and both truncate from the same end:
| Value, compared with the target's width | RSet |
|---|---|
| Shorter | Right-aligned: padded at the start. |
| Longer | Truncated from the same end as LSet. |
RSet has no UDT form: unlike LSet, it does not copy one UDT over another. See
RD-VBAL §5.4.3.6 LSet Statement.
Implementation
RDCore.Runtime.Semantics.Statements.StatementRuntimeSemanticsProvider dispatches an AssignmentStatementNode
whose Kind is LSet or RSet; see RD-VBAL §3.5.4 Execution.
⏮️ RD-VBAL §5.4.3.6 LSet Statement | ⏭️ RD-VBAL §5.4.3.8 Let Statement