Skip to content

SkipComments

Skip SQL comments.

Declaration

Source position: db.pas line 2524

function SkipComments(var p: PChar; EscapeSlash: Boolean; 
                     EscapeRepeat: Boolean) : Boolean;

Arguments

Name Description
p Pointer to null-terminated string containing a SQL statement.
EscapeSlash Is a backslash an escape character.
EscapeRepeat Are repeated quotes considered a single character.

Function result

True if a comment was skipped.

Description

SkipComments examines the null-terminated string in P and skips any SQL comment or string literal found at the start. It returns P the first non-comment or non-string literal position. The EscapeSlash parameter determines whether the backslash character (\) functions as an escape character (i.e. the following character is not considered a delimiter). EscapeRepeat must be set to True if the quote character is repeated to indicate itself.

The function returns True if a comment was found and skipped, False otherwise.

Errors

No checks are done on the validity of P.

See also

Name Description
TParams.ParseSQL Parse SQL statement, replacing parameter names with SQL parameter placeholders.