Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
MicroStation
  • Product Communities
  • More
MicroStation
MicroStation Wiki MicroStation BASIC Limits [FAQ]
    • Sign in

    • +MicroStation Wiki
    • +Administration Wiki
    • +Annotations Wiki
    • +Bentley View Wiki
    • +MicroStation PowerDraft
    • -Programming Wiki
      • A class to help create and modify text element
      • A Complete Example
      • A MicroStation VBA Example With Bentley ProjectWise
      • AddIn Development Using VB.NET
      • C# .NET Template with IPrimitiveCommandEvents Class
      • Capturing Graphics in Dynamic Views
      • Compiling MDL Applications
      • Database Manipulation
      • Debugging Native Code MDL Applications
      • Developing Code in VBA
      • Developing MicroStation Applications For DWG Files
      • Drag and Drop in MicroStation
      • Error: "Cannot save changes to VBA project 'Support' because it is read-only"
      • Getting And Setting Elements Using Graphic Groups In VBA [CS]
      • Getting Started with Visual Basic
      • How To Write A Recursive Routine In MicroStation VBA [CS]
      • Introducing Segment3D Methods In MicroStation V8 2004 Edition
      • Known issues in MDL and MicroStationAPI
      • Launching VBA Applications As Initapps Or Dgnapps [CS]
      • Learning MicroStation Addins Step by Step
      • MDL - Getting Started With XAttributes In MicroStation V8 XM Edition
      • MDL - Native Code Application Development
      • MDL Or MicroStation BASIC Choosing The Right Tool [TN]
      • MFC Dialog And Native Window Support
      • Microsoft Office VBA Patch Utility
      • MicroStation BASIC FAQ
      • MicroStation BASIC Limits [FAQ]
      • MicroStation Developer Documentation and Example Code
      • MicroStation Programming Advice
      • MicroStation SDK
      • MicroStation V8 Programming Tools Readme
      • MicroStation V8 VBA Programming Resources [CS]
      • MicroStation V8 XM Edition View Code Updates
      • MicroStation VBA Resources Revisited [CS]
      • Migrating Dimension Code To MicroStation V8
      • Migrating MDL Applications To Native Code
      • Mouse Wheel Events And The Visual Basic 6.0 IDE
      • Porting MDL Applications To MicroStation V8
      • Reading Elements From A Microsoft Access Database With VBA [CS]
      • Running MDL Applications
      • Scanning For MicroStation V8 Elements In VBA [CS]
      • Unleash A Workspace Wizard Automating Workspace Creation With MicroStation V8 And VBA [CS]
      • Using VBA To Detect The Current Or Last Used Command
      • Using VBA To Programmatically Export A VBA Project [CS]
      • Using VBA To Programmatically Import A VBA Projects Components And References [CS]
      • VBA -- Creating A Complex Application
      • VBA Interface Error: failed creating the comp manager - 0x80040583
      • VBA interface error: unable to get IDE
      • vba recording
      • Working With Levels In MicroStation VBA [CS]
      • Writing An MDL Application To Output Custom Placemarks To Google Earth
      • [V8i C++] PointCloud IPointCloudChannelDisplayHandler
    • +Visualization Wiki

     
     Questions about this article, topic, or product? Click here. 

    MicroStation BASIC Limits [FAQ]

       
      Applies To 
       
      Product(s): MicroStation
      Version(s): All
      Environment:  N/A
      Area:  N/A
      Subarea:  N/A
      Original Author: Bentley Technical Support Group
       

     

     

     

     

     

     

     

     

    Important Note

    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.

      What is the limit on total Strings?

    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).

      What is the limit for the runtime stack?

    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.

      What is the limit for private data space?

    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.

      What is the limit for public data 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.

      What is the max size for a source file?

    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.

      What is the max compiled code size?

    The max size of the compiled code segment is 64 K Bytes

      What is the max size of the symbol table?

    The maximum size of the symbol table is 64K. The symbol table is used by runtime error handlers and the debugger.

      How many dimensions can be in a multiple dimension array?

    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.

      What is the max length for variable names and labels?

    The max length of a variable name or label is 40 characters.

      What is the limit on DDE channels?

    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.

      What is the limit on the number of open files?

    The number of open files is limited to 255 or the operating system limit, whichever is less.

      What is max size of a single string?

    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.

      What is the nesting levels of loops?

    The number of nesting levels is limited by compiler memory.

      What is the text file input/output buffer size?

    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.

      What is the limit on size of an array?

    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...

    1. The data size, which in this case is 24 bytes ( an MbePoint is made up of three doubles of eight bytes each)
    2. The number of dimensions, in this case is three
    3. The number of indices for each dimension, (Upper bound - lower bound + 1), in this case 6, 10, 20.

    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

    Which turns out to be 24 * (511-1+1)(2-1+1) = 24528

    See Also

    Product TechNotes and FAQs

    MicroStation Desktop TechNotes and FAQs

    External Links

    Bentley Technical Support KnowledgeBase

    Bentley LEARN Server

    Comments or Corrections?

    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!

     

       

    • MicroStation BASIC
    • max
    • data space
    • FAQ
    • limit
    • source file
    • array
    • FAQ6122
    • code
    • DDE channel
    • String
    • symbol table
    • Dimension
    • Share
    • History
    • More
    • Cancel
    • Hannah Blye Created by Hannah Blye
    • When: Mon, Jun 30 2008 8:34 AM
    • Dan Koval Last revision by Bentley Colleague Dan Koval
    • When: Mon, Aug 26 2013 9:13 AM
    • Revisions: 12
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2021 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies