Article ID: 80563
Article Last Modified on 8/16/2005
APPLIES TO
- Microsoft BASIC Professional Development System 7.1
- Microsoft BASIC Professional Development System 7.0
This article was previously published under Q80563
SUMMARY
String data for far strings allocated in a named COMMON block is stored in the string segment for module level strings, not in the segment for unnamed COMMON strings. Table 11.1, "Storage Allocation with Near and Far Strings" on page 403 of the "Microsoft Basic 7.0: Programmer's Guide" for Basic PDS versions 7.0 and 7.1 does not clearly indicate this feature. Named COMMON strings are stored in the module level string segment in both programs compiled for far strings (with the /Fs option) and in the QBX.EXE environment.
This information applies to Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2.
MORE INFORMATION
When you use far strings in Basic PDS 7.0 and 7.1, far string data is stored in one of several separate string segments according to where the string is created. Table 11.1 on page 403 of the "Microsoft Basic 7.0: Programmer's Guide," reproduced below, documents which string segments hold which type of far string.
Type of string data|Near string allocation|Far string allocation
String or string |DGROUP |Independent 64K array created in | |segment
main module | |
Simple string |DGROUP |Second 64K segment - created at | |shared by all
procedure level | |procedures
Simple COMMON |DGROUP |Third 64K segment - strings | |for all COMMON
| |strings
String array |DGROUP |Additional 64K created in | |segments - one per
procedure | |invocation
Note that this table seems to indicate that far strings defined in a named COMMON block are stored in the same segment as strings defined in an unnamed COMMON block. This is not true, and the table should state that far string arrays defined in a named COMMON block are stored in the same segment as standard module level strings. A revised version of Table 11.1 is as follows:
---------------------------------------------------------------- Type of string data|Near string allocation|Far string allocation ---------------------------------------------------------------- String or string |DGROUP |Independent 64K array created in | |segment main module | | ---------------------------------------------------------------- Simple string |DGROUP |Second 64K segment - created at | |shared by all procedure level | |procedures ---------------------------------------------------------------- Simple COMMON |DGROUP |Third 64K segment - strings | |for all COMMON | |strings ---------------------------------------------------------------- String array |DGROUP |Additional 64K created in | |segments - one per procedure | |invocation ----------------------------------------------------------------
Additional query words: BasicCom 7.00 7.10
Keywords: KB80563