Microsoft KB Archive/47786

Use of MID Function to Extract a Specified Range of Characters

PSS ID Number: Q47786 Article last modified on 11-02-1994

5.00

MS-DOS

= SUMMARY =

The MID function is used in a macro to extract a specified range of characters from a string. The MID function requires that you supply three elements to define the range: the string name (this can be a variable or a constant), the number of the first character in the range, and the number of characters you want to include in the range. For example:

<>

In this example, the string to be acted upon is the value of the variable “zipcode”. The range begins at the first character (1) and extends to include the fifth (5). The value of result, then, is the first five characters of “zipcode”.

KBCategory: kbother kbmacro KBSubcategory: Additional reference words: ============================================================================= Copyright Microsoft Corporation 1994.