home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / ARQS_ZIP / VBMEMORY.ZIP / VBMEMORY.TXT
Encoding:
Text File  |  1991-07-19  |  3.9 KB  |  98 lines

  1. Q72879 Memory Limits in Visual Basic for Windows
  2. Microsoft Visual Basic (VBASIC)
  3. 1.00
  4. WINDOWS
  5.  
  6. Summary:
  7.  
  8. The following memory limitations apply to Microsoft Visual Basic
  9. programming system version 1.0 for Windows.
  10.  
  11. Note: This information only applies when running the retail version of
  12. Microsoft Windows version 3.0. Different memory limitations may apply
  13. when running Visual Basic under the debug version of Windows provided
  14. with the Microsoft Windows Software Development Kit (SDK).
  15.  
  16. More Information:
  17.  
  18. Each Function or Sub procedure can have up to 64K of pseudo code
  19. (pcode).
  20.  
  21. Each Form, Module, and Global Module gets its own data segment (up to
  22. 64K in size) for the allocation of all static data, strings, and
  23. simple variables (declared in the General section and Sub and Function
  24. procedures).
  25.  
  26. Each array of any data type gets its own data segment, up to 64K in
  27. size. Arrays larger than 64K cause a "subscript out of range" error.
  28.  
  29. Huge arrays (arrays larger than 64K) are not directly supported in
  30. Visual Basic, but you can support huge arrays through the use of a
  31. Windows dynamic-link library (DLL). A separate article discussing
  32. support for huge arrays can be found by querying on the following
  33. words:
  34.  
  35.    huge and array and DLL
  36.  
  37. The properties for all controls on a form and the properties of
  38. the form itself go into a single data segment limited to 64K bytes,
  39. except the following:
  40.  
  41.    The List() property of a List Box
  42.    The List() property of a Combo Box
  43.    The Text property of a Text Box
  44.  
  45. The List() property gets its own data segment, limited to 64K bytes,
  46. for each List Box and Combo Box. The Text property of a Text Box has a
  47. default size limit of 32K, which can be increased to 64K with a call
  48. to a Windows API function. For more information on how to increase the
  49. amount of text (from 32K to 64K) that can be entered into a Text Box,
  50. query on the following words:
  51.  
  52.    windows and api and sendmessage and textlimit
  53.  
  54. Other memory limits relating to the properties of Controls and Forms
  55. include:
  56.  
  57. 1. Each item in the List() property can be up to 1K in size, any item
  58.    over this limit is truncated.
  59.  
  60. 2. The Caption property of a control can be up to 1K in size, any
  61.    Caption over this limit is truncated.
  62.  
  63. 3. The Tag property of a control can be up to 32K in size, any Tag
  64.    over 32K causes an "out of memory" error.
  65.  
  66. There is one name-and-symbol table up to 32K in size per Form, Module,
  67. or Global Module. A name-and-symbol table contains the actual text of
  68. Sub function and Sub procedure names, variable names, line numbers,
  69. line labels, and an additional 4 bytes overhead for each of these
  70. names and symbols.
  71.  
  72. If the 32K size limit is exceeded for a name-and-symbol table, an "out
  73. of memory" error will occur. To solve this, break up the Form or
  74. Module into multiple Forms or Modules. Note, this cannot be done with
  75. the Global Module. Only one Global Module is allowed; if you exhaust
  76. the Global Module's name-and-symbol table, there is no workaround,
  77. other than to use shorter variable names.
  78.  
  79. The stack is 16K in size, with just one stack per application. The 16K
  80. stack size cannot be changed. Note that an "out of stack space" error
  81. can easily occur when your program uses uncontrolled recursion.
  82.  
  83. If you run Visual Basic on the debug version of Microsoft
  84. Windows provided with the Microsoft Windows SDK, all properties
  85. (including List() and Text properties) go into a single segment, up to
  86. 64K in size per Form or Module. Other memory management limits may
  87. also differ under the debug version of Microsoft Windows. The debug
  88. version of Windows is created by copying a set of dynamic-link library
  89. (DLL) files from the Windows SDK into your \WINDOWS\SYSTEM
  90. subdirectory. These special DLLs perform additional error checking,
  91. including a check for stack overflow.
  92.  
  93. Keywords:  SR# S910530-193
  94.  
  95. COPYRIGHT Microsoft Corporation, 1991.
  96. Updated  91/06/27 06:46
  97.  
  98.