Microsoft KB Archive/68322

Val(C$(1)) Returns Illegal Function Call in Word for Windows

PSS ID Number: Q68322 Article last modified on 10-21-1991

1.00 1.10 1.10a 2.00 WINDOWS

Summary: The following macro written in Word for Windows Sub MAIN Dim iC$(2) C$ (1) = “d” If Val(C$(1)) = 13 Then FOO Foo: End Sub returns a “WordBASIC ERR=5 Illegal function call” message for the letters “d” and “e” in both uppercase and lowercase, or any word that begins with “d/D” or “e/E”.

More Information: VAL(C$(1)) will return 0 for all letters, but returns the error message for the characters “d” and “e”. Microsoft has confirmed this to be a problem in Word for Windows versions 1.0, 1.1, and 1.1a. This problem was corrected in Word for Windows 2.0.

Reference(s): “Microsoft Word for Windows Technical Reference,” version 1.1, pages 39, 101, 111, and 121.

Additional reference words: w4wmacro 2.0 2.00