Skip to content

TPascalCodeGenerator.EscapeKeyWord

Escape Pascal keyword if needed

Declaration

Source position: pascodegen.pp line 88

public 
function TPascalCodeGenerator.EscapeKeyWord(const S: string; 
                                           ForceAmpersand: Boolean=False)
                                            : string;  virtual;

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 TPascalCodeGenerator.KeywordPrefix and TPascalCodeGenerator.KeywordSuffix or an ampersand (&) if ForceAmpersand is True.

See also

Name Description
TPascalCodeGenerator.IsKeyWord Check if string is Pascal keyword
TPascalCodeGenerator.KeywordPrefix Prefix for escaped keywords
TPascalCodeGenerator.KeywordSuffix Suffix for escaped keywords