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 at the time they are output. For example, reference to a sub-program's line number. Use the following code to output a deferred variable.

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

Use the following code at the place where the variable is known and gets defined (for example, the line number becomes known).

Deferred variable ids will be replaced with the value of the deferred variables at the end of processing.

Since
r45238

Member Function Documentation

◆ get()

static String get ( String  id,
Format  format 
)
static

Function for retrieving the deferred variable for output.

Parameters
idAn unique string identifier of deferred variable to output.
formatFormatNumber used to format a numeric variable. 'format' is optional and won't be used to format non-numeric values. If it is not specified, then numeric values are not formatted prior to output.
Returns
Returns the formatted string of the deferred variable, if it is defined, and string "##ID##", if not. If the variable is not defined, then the post will fail with an error after it has finished processing and a '.failed' file will be generated.

◆ 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 a unique test string that cannot be found in the output. Default value: "##"



Generated by Autodesk, Inc. 31 January 2025
Copyright (c) 2012-2025 by Autodesk, Inc.