Sign in Join
FPDoc Onlineexperiment

TPascalCodeGenerator.EscapeKeyWord function

Member of TPascalCodeGeneratorpublicIn unit PasCodeGen

Escape Pascal keyword if needed

Declaration

pascal
function EscapeKeyWord(const S: string; ForceAmpersand: Boolean=False)
: string; virtual

Arguments

S

String to escape

ForceAmpersand

Force ampersand prefix instead of configured prefix/suffix

Function result

Escaped string

Description

EscapeKeyWord escapes a string if it is a Pascal keyword by adding prefix and suffix characters. If the string is a keyword, it adds the configured KeywordPrefix and KeywordSuffix or an ampersand (&) if ForceAmpersand is True.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.