Skip to content

TPascalCodeGenerator.MakePascalString

Convert string to Pascal string literal

Declaration

Source position: pascodegen.pp line 89

public 
function TPascalCodeGenerator.MakePascalString(const S: string; 
                                              AddQuotes: Boolean=False)
                                               : string;

Description

MakePascalString converts a string to a proper Pascal string literal by escaping single quotes. All single quotes in the input string are doubled to create valid Pascal string syntax. Optionally, the result can be wrapped in quotes.