UIEvolutin Inc.
UJML Language Reference
_x_getBagInt()

The _x_getBagInt() function returns an int value from a property bag, or an optional default value.

UJML Script Syntax
int _x_getBagInt(string bagName, int key [, int default])
Parameters 
Description 
bagName 
The name of a loaded property bag. See _x_loadBag() function
key 
An int expression or value representing the key of the item. 
default 
An int expression or value to use as a default if the key does not exist (not required). 

The _x_getBagInt() function returns an int value from a property bag, or an optional default value.

This function retrieves an int value with the referenced key from the named property bag. See Property Bag Functions. If the key does not exist it returns either zero or the optional default value.

The following example shows how to get values from a property bag. It is part of the visualelements.ujml sample.

mFontSize =
    _x_getBagInt("&BAG_NAME;", &BAG_FONT_SIZE;, &DEFAULT_FONT_SIZE;);
mFontFace =
    _x_getBagInt("&BAG_NAME;", &BAG_FONT_FACE;, &DEFAULT_FONT_FACE;);
mForeColor =
    _x_getBagInt("&BAG_NAME;", &BAG_FORE_COLOR;, &DEFAULT_FORE_COLOR;);
mBackColor =
    _x_getBagInt("&BAG_NAME;", &BAG_BACK_COLOR;, &DEFAULT_BACK_COLOR;);
mOpacity =
    _x_getBagInt("&BAG_NAME;", &BAG_OPACITY;, &DEFAULT_OPACITY;);
Copyright (c) 2000-2007 UIEvolution, Inc. All rights reserved.
What do you think about this topic? Send feedback!