Xbasic

QUOTE Function

Syntax

QuotedString as C = QUOTE(C string [,C quoteChar])

Arguments

stringCharacter

A character string.

quoteCharCharacter

The default value is (\"). The character to place at the beginning and end of Input_String.

Description

Returns the quoted value - useful for expressions generating other expressions.

Discussion

QUOTE() places quotes around Input_String and returns the result as a string. QUOTE() is most useful within Xbasic scripts.If Quote_Character is not supplied, Alpha Anywhere uses double quotes (prefixed with the escape character "\" because you can't otherwise use double quotes within double quotes). (e.g. "\"Alpha\"" ).

Do not use QUOTE() in HTML expressions. It escapes quote characters in a manner inconsistent with HTML coding requirements.
? quote("Alpha")
= "Alpha"

? quote("Alpha","'")
= "'Alpha'"

The QUOTE() function is intended for use to help you form filter and order expression in Xbasic. The following examples in the Interactive window illustrate how the function can be used:

query.filter = "company = " + quote("Alpha")
? query.filter
= company = "Alpha"

WhatName = "Alpha"
query.filter = "company = " + quote(WhatName)
? query.filter
= company = "Alpha"

See Also