Static Public Member Functions | Static Public Attributes | List of all members
DeferredVariables Class Reference

Static Public Member Functions

static String get (String id, Format format)
 
static set (String id, Number value)
 

Static Public Attributes

static String separator
 

Detailed Description

Deferred variables handling class.

This class is used for handling values, which are not known during outputting. For example, reference to sub-program's line number. For outputting deferred variable write:

writeBlock(DeferredVariables.get(id, format));

"id" - is an unique string identifier of variable to output; "format" - format, that should be used to format variable.

At place, where variable gets defined (for example, line number becomes known) write following code:

"id" - is a same identifier, that was used during output; "value" - is an actual value of the variable.

If at least one deferred variable was written to output file, termination handler is set to replace them with actual values at the end of processing.

Since
r45238

Member Function Documentation

◆ get()

static String get ( String  id,
Format  format 
)
static

Function for getting deferred variable for printing to output.

Parameters
idAn unique string identifier of variable to output.
formatFormat, that should be used to format variable.
Returns
Returns formatted value of deferred variable, if it is defined, and string "##ID##", if not. If variable is not defined, it sets termination handler for replacing variables in output.

◆ set()

static set ( String  id,
Number  value 
)
static

Function for setting deferred variable's value.

Parameters
idAn unique string identifier of variable to output.
valueActual value of variable.

Member Data Documentation

◆ separator

String separator
static

Deferred variables id separator.

This property should be set to something, that cannot be found in output. Default value: "##"



Generated by Autodesk, Inc. 19 April 2024
Copyright (c) 2012-2024 by Autodesk, Inc.