Basic PDS ISAM Stores Blanks for Fixed-Length Strings > 255 (72318)






This article was previously published under Q72318

SUMMARY

For ISAM records that have fixed-length strings longer than 255 characters, the string is padded with blanks and ISAM stores the string with the blanks. This behavior is unusual when compared to how ISAM handles fixed-length strings of 255 characters or less, where only the string itself, and not trailing blanks, is stored.

This information applies to Microsoft Basic Professional Development System (PDS) version 7.0 for MS-DOS, and version 7.1 for MS-DOS and OS/2.

MORE INFORMATION

When a fixed-length string is greater than 255 characters, the internal representation of the field in the ISAM database changes from a "VariableText" or "VariableString", to a "Memo" field. A Memo field is considered an aggregate data type.

As an aggregate data type, similar to arrays and nested user-defined types, the string is no longer indexable, and when the record is inserted into the database, every byte is written, including the blanks. This can cause an ISAM database to grow rather quickly. The only way to avoid this behavior is to use fixed-length strings shorter than 256 characters.

The following TYPE..END TYPE declaration gives examples of fixed-length strings that will and will not store blanks in an ISAM database. For example:
   TYPE Record
           SmallStr AS STRING * 250  'This won't store blanks
           LargeStr AS STRING * 750  'This will store blanks
   END TYPE
				
For more information on ISAM data types, refer to pages 333-334 of the "Microsoft Basic 7.0: Programmer's Guide" for versions 7.0 and 7.1.

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB72318