In MicroStation V8, Microsoft's Visual Basic for Applications (or VBA) was introduced. Although there are some similarities in concepts between MicroStation BASIC and VBA, Bentley HIGHLY recommends using VBA and not MicroStation BASIC in any MicroStation V8 version.
The "string space", a memory allocation block used to contain strings as well as arrays, is limited to 1 MB. This includes all strings and arrays (public, private and local).
The runtime stack is limited to 2,048 bytes. This space contains all local variables except arrays and strings. Each GoSub requires 2 bytes of runtime stack.
The private data space is allocated exactly to the size required by the private variables, up to a maximum of 32 K. This data space contains all private variables except strings and arrays which are in string space.
The public data space is allocated to exactly hold the public variables in use by all loaded macros, up to a maximum of 16 K. This data space contains all public variables except strings and arrays, which are stored in the string space.
The source file size is limited to 64 K bytes. (65535 characters) This size is the size of the source when normalized. The process of normalization will treat any string of spaces as a single character. If a line contains 7 spaces to line up the command with the line above it, that will count as one character. A tab takes up one character.
The max size of the compiled code segment is 64 K Bytes
The maximum size of the symbol table is 64K. The symbol table is used by runtime error handlers and the debugger.
The maximum number of dimensions for an array is 60.
Dim Multi(3, 1 to 10, 1 to 15)
This declaration creates an array that has three dimensions with sizes 4 by 10 by 15. The total number of elements is the product of these three dimensions, or 600.
The max length of a variable name or label is 40 characters.
The limit is not fixed. The limited is determined by the available memory and system resources. This feature is restricted to the Windows platform only. The initial release of PowerDraft does not support DDE from BASIC, but the maintenance release includes DDE support.
The number of open files is limited to 255 or the operating system limit, whichever is less.
The number of characters within a string literal is limited to 255. This is a string enclosed within quotation marks. Strings can be concatenated using the plus [+] operator with the normal string limit of 32,767 characters.
The number of nesting levels is limited by compiler memory.
The maximum size of a single input/output operations is 512 bytes. When using the Input # or Print # statement the largest string which can be read/written to the file in a single operation is 512 bytes in length.
There is a limit of 64K of data space for an array. To determine the size of an array apply the following calculation.
data size * (number of element in array + 1) <= 64K Bytes
For example an array with three dimensions and made of MbePoint would be as follows:
Dim array(0 to 5,1 to 10,11 to 30) as MbePoint
There are three variables to this equation...
The formula applied for this array generates the following:
24 * (5-0+1) * (10-1+1)* (30-11+1) = 28800 <= 65536 = 64K Bytes
The code below uses this string:
Option Base 1
Dim points (511,2) As MbePoint
Dim points (511,2) As MbePoint
Which turns out to be 24 * (511-1+1)(2-1+1) = 24528
Product TechNotes and FAQs
MicroStation Desktop TechNotes and FAQs
Bentley Technical Support KnowledgeBase
Bentley LEARN Server
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!