Class: QgsVbScript

Parses and encapsulates an entire VBScript script.

Added in version 4.4.

List of all members, including inherited members

Constructor

__init__

Methods

acceptVisitor

Accepts a visitor to traverse the script abstract syntax tree.

dump

Dumps the abstract syntax tree back into an Arcade script string.

hasParserError

Returns True if a parsing error occurred.

parserErrorString

Returns parser error description.

rootBlock

Returns the root block statement node, or None if parsing failed.

script

Returns the original script text.

Static Methods

extractFieldReference

Strips enclosing square brackets from text and unescapes double right brackets.

quotedFieldReference

Returns a field name enclosed in square brackets with internal right brackets escaped.

quotedString

Returns a properly quoted string literal (enclosed in double quotes with escape sequences).

class qgis.core.QgsVbScript[source]

Bases: object

__init__(scriptText: str | None = '')

Creates a new script from scriptText.

Parameters:

scriptText (str|None = '')

__init__(other: QgsVbScript)
Parameters:

other (QgsVbScript)

acceptVisitor(self, visitor: QgsVbScriptVisitor)[source]

Accepts a visitor to traverse the script abstract syntax tree.

Parameters:

visitor (QgsVbScriptVisitor)

dump(self) → str[source]

Dumps the abstract syntax tree back into an Arcade script string.

Return type:

str

static extractFieldReference(text: str | None) → str[source]

Strips enclosing square brackets from text and unescapes double right brackets.

Parameters:

text (str|None)

Return type:

str

hasParserError(self) → bool[source]

Returns True if a parsing error occurred.

Return type:

bool

parserErrorString(self) → str[source]

Returns parser error description.

Return type:

str

static quotedFieldReference(fieldName: str | None) → str[source]

Returns a field name enclosed in square brackets with internal right brackets escaped.

Parameters:

fieldName (str|None)

Return type:

str

static quotedString(text: str | None) → str[source]

Returns a properly quoted string literal (enclosed in double quotes with escape sequences).

Parameters:

text (str|None)

Return type:

str

rootBlock(self) → QgsVbScriptBlockStatement | None[source]

Returns the root block statement node, or None if parsing failed.

Return type:

QgsVbScriptBlockStatement|None

script(self) → str[source]

Returns the original script text.

Return type:

str