Microsoft KB Archive/65826

General Guidelines for Using Text Strings that Require Quotes PSS ID Number: Q65826 Article last modified on 07-14-1994

1.00 1.10 1.10a 2.00 2.00a 2.00a-CD 2.00b 2.00c

WINDOWS

= SUMMARY =

WordBASIC supports two basic data types: strings and numbers. Strings can contain up to 32,000 characters, depending on the amount of memory available. DDEExecute strings, however, can only contain up to 255 characters. Here are some examples of strings and string variables:

String Variable (Always has a $ denoting string) Value Result —————- —— ——

Text$ = “This is a string” A$ = “This is” B$ = “a test” C$ = A$ + B$ “This is a test” NUM$ “123”

If the string or string variable needs to have one or more quotations contained in it, the quotation must be entered as the ASCII character 34, or Chr$(34). Here are some examples:

Correct: Incorrect: ——- ———

Sub MAIN Sub MAIN Q$ = Chr$(34) EditSearch ""macro"" EditSearch Q$ +“macro”+Q$ End Sub End Sub

Sub MAIN Sub MAIN Q$ = Chr$(34) ChanNum = DDEInitiate("EXCEL", ChanNum = DDEInitiate("EXCEL", "") "") DDEExecute ChanNum, DDEExecute ChanNum, "[OPEN("+ Q$ + “[OPEN(&quot;TEST.XLS&quot;)]” “TEST.XLS”+Q$+“)]” End Sub End Sub

= REFERENCES =

“Microsoft Word for Windows and OS/2 Technical Reference.” pages 22, 315.

Additional reference words: 1.00 1.10 1.10a w4wmacro 2.00 2.00a winword 2.00a-CD 2.00b 2.00c

=
================================================================

Copyright Microsoft Corporation 1994.