6.1.2.8 Interaction
Note
This section describes the implementation of MS-VBAL §6.1.2.8 Interaction.
The Interaction module is represented in the SDK by the interface
IStdInteractionModule.
The application settings members (GetAllSettings, GetSetting, SaveSetting, DeleteSetting, and the RD-VBA variants
GetAllJsonSettings, GetJsonSetting and SaveJsonSetting) are described with the implicit storage they use, in
RD-VBAL §2.1 Implicit Storage. The legacy members use the workspace's appsettings.json,
unless the environment asks for the Windows Registry (LegacyRegistrySettings, Windows only).
What the module reaches outside the platform is the environment host's to provide (ExternalWorld):
| Concern | Windows | Elsewhere (e.g. a build machine) | Interactive shell (rdc.exe) |
An analysis |
|---|---|---|---|---|
MsgBox, InputBox |
The dialogs of Windows. | None: a dialog answers as though it were confirmed at once (default button, default text). | Asked at the shell's console, on any platform. | None. |
DoEvents |
Processes the messages of the thread, and the events of the objects of a library that wait for the session. | Does nothing. | As the platform. | Does nothing. |
Beep, AppActivate, SendKeys, Shell |
Windows' own. | Do nothing; Shell answers 0. |
As the platform. | Do nothing. |
| Settings | appsettings.json, or the registry when asked for. |
appsettings.json. |
As the platform. | Nothing is read, and nothing kept. |
Esc closes a dialog at window level. A MsgBox closed that way answers vbCancel (vbOK when OK is its only button); one that cannot be closed without choosing (vbYesNo, vbAbortRetryIgnore) ignores Esc, as on Windows. An InputBox closed that way answers vbNullString, which is how a caller tells a cancelled dialog (StrPtr(answer) = 0) from one confirmed empty ("").
6.1.2.8.1 Public Functions
Note
This section describes the implementation of MS-VBAL §6.1.2.8.1 Public Functions.
GetAllJsonSettings and GetJsonSetting are RD-VBA variants of GetAllSettings and GetSetting, and take a child
number of the member they vary. MacScript, a hidden member of the module, resolves and raises a run-time error: RD-VBA has no AppleScript to run.
| § | Member | Notes |
|---|---|---|
| 6.1.2.8.1.1 | CallByName | Late-bound, on the default interface of the object's class; on a late-bound object (CreateObject), by the name. Arguments are passed by value; one it is not given is what a call written in source gives it, its declared default or Missing. VbGet gets a Property Get or a public variable (a Function is error 450); VbLet and VbSet assign a Property Let, a Property Set, or a public variable, as an assignment written in source does: no value is error 446, two are 451, a Set of what is no object, or of an object of another class, 13, as MS-VBA has it (recorded in Excel). |
| 6.1.2.8.1.2 | Choose | An index that is not a whole number is rounded as a Single is Let-coerced to a Long (banker's rounding). |
| 6.1.2.8.1.3 | Command | ✅ A String (in a Variant for Command): the arguments the host says the program was started with, which are none unless it says otherwise, as in a program an Office application runs. |
| 6.1.2.8.1.4 | CreateObject | ✅ A class the platform implements itself is found first, on any platform (VBScript.RegExp, RD-VBAL §6.2); then the automation servers of the machine (Windows only; elsewhere error 429). The programmatic identifier is not case-sensitive. An object of a class that a referenced library declares is an object of that class; any other is late-bound: its members are reached by name when they are called, and TypeName is the name of its class (Dictionary). Errors as MS-VBA: 429 for a class nothing can create (an empty or dot-less name included), the server's own error number for a machine that is not there (-2147023174), 438 for a member the object does not have. A late-bound member is given a variable by reference, as the type it is declared, and what the server writes into it is the variable's (RD-VBAL §5.3.1.11). An identifier written as a literal or a constant tells tooling the class of the object, from the description of its library, referenced or not; that is never a compile error, and the object stays late-bound. Of a class a referenced library declares, RDC00311 suggests New. |
| 6.1.2.8.1.5 | DoEvents | |
| 6.1.2.8.1.6 | Environ / Environ$ | Names are found without regard to case; %NAME% names the variable NAME. On Windows the %NAME% macros of a value are expanded. Environ(n) numbers the variables in order of their names. |
| 6.1.2.8.1.7 | GetAllSettings | Backed by the workspace application settings, unless the environment asks for the Windows Registry. See RD-VBAL §2.1 Implicit Storage. |
| 6.1.2.8.1.7.1 | 🧩 GetAllJsonSettings |
RD-VBA variant of GetAllSettings over workspace application settings. See RD-VBAL §2.1 Implicit Storage. |
| 6.1.2.8.1.8 | GetAttr | ✅ Through the session's file channels, as the FileSystem module (RD-VBAL §6.1.2.5). Error 53 for what does not exist, 52 for a pattern. |
| 6.1.2.8.1.9 | GetObject | ✅ Windows only, as CreateObject. GetObject(, "Class") is the running object of the class, or error 429; GetObject("", "Class") is a new one. A path is a file, opened by the class given or by the one the file names, or a moniker (GetObject("winmgmts:")); a file that cannot be opened is error 432. Given neither a path nor a class, error 13; an empty path and no class, error 5. |
| 6.1.2.8.1.10 | GetSetting | Backed by the workspace application settings, unless the environment asks for the Windows Registry. See RD-VBAL §2.1 Implicit Storage. |
| 6.1.2.8.1.10.1 | 🧩 GetJsonSetting |
RD-VBA variant of GetSetting over workspace application settings. See RD-VBAL §2.1 Implicit Storage. |
| 6.1.2.8.1.11 | IIf | Both parts are evaluated. A Null expression returns the false part. |
| 6.1.2.8.1.12 | InputBox | |
| 6.1.2.8.1.13 | MsgBox | |
| 6.1.2.8.1.14 | Partition | ✅ As MS-VBA: each side of the colon is padded to the width of the wider of Start - 1 and Stop + 1, which the specification's "characters in Stop, plus one" is only for some ranges (Partition(195, 20, 199, 10) is "190:199"). Each part is rounded to a whole number half to even; one too large for a Long is past the range. A Null part is a Null result, before anything else is checked; a Start below 0, a Stop not after Start, or an Interval below 1 is error 5. |
| 6.1.2.8.1.15 | Shell | |
| 6.1.2.8.1.16 | Switch | A Null expression is not True. No True expression returns Null; unpaired arguments are error 5. |
6.1.2.8.2 Public Subroutines
Note
This section describes the implementation of MS-VBAL §6.1.2.8.2 Public Subroutines.
| § | Member | Notes |
|---|---|---|
| 6.1.2.8.2.1 | AppActivate | |
| 6.1.2.8.2.2 | Beep | |
| 6.1.2.8.2.3 | DeleteSetting | Given no section, deletes every section of the application. A setting that does not exist is error 5. |
| 6.1.2.8.2.4 | SaveSetting | |
| 6.1.2.8.2.4.1 | 🧩 SaveJsonSetting |
RD-VBA variant of SaveSetting over workspace application settings. See RD-VBAL §2.1 Implicit Storage. |
| 6.1.2.8.2.5 | SendKeys |
⏮️ RD-VBAL §6.1.2.7 Information | ⏭️ RD-VBAL §6.1.2.9 KeyCodeConstants