Microsoft KB Archive/50160

From BetaArchive Wiki

WordBasic Asc() Function Defined

PSS ID Number: Q50160 Article last modified on 02-17-1993

1.00 1.10 1.10a 2.00 WINDOWS

Summary: The WordBasic Asc() function returns a numeric value that is the ANSI code for the first character in a character expression. The Asc() function is often used for character-by-character validation of input coming from the keyboard.

Syntax (either of the following)

Num = Asc(“Char_Expr”) The Character_Expr must be enclosed in double quotation marks, or must be a string variable. Num = Asc(VariableName$)

Sample

To find the ANSI numeric value for X, use the following function: Print Asc(“X”) Result: The number 88 will be displayed in the status bar. If a string variable is used as the argument, then Asc() returns the numeric value of the first character of the string. For more information on WordBasic functions and commands, please refer to the “Microsoft Word for Windows and OS/2 Technical Reference” manual.

Reference(s): “Microsoft Word for Windows and OS/2 Technical Reference,” page 133.

Additional reference words: w4wmacro 1.00 1.10 1.10a 1.0 1.1 1.1a 2.0 2.00