本帖最后由 zorsite 于 2016-4-6 10:41 编辑
常用标签命令汇总:
assertlabel
(obj object, strlabelname, num datatype) Gets a reference to label labelname, creating the labelif it does not exist Description This command returns a reference to alabel with the given name. If the label does not exist, one is created with thedefined data type. Example treenode newlabel =assertlabel(node("/Processor1",model()),"MyLabel",DATATYPE_NUMBER);
dellabel
(obj object,str/num label) Delete the label from object Description Deletes the specified label from the nodecalled "labels" on the specified object.
The specified label can either be the labelname as a string or the label's rankas a number.
If the label does not exist in that node, this command does nothing. Example dellabel(current,"MyLabel")
getlabel
(obj node, str/numlabel) Gets the value of an object's label. Description Returns a label's value. The labelparameter can either be the name of the label or its rank number.
If the label does not exist, this command returns a null Variant (nullvar),which is different than 0 (NULL). Example getlabel(so(), "ProcessTime")
if (getlabel(item, "nonexistent_label") == nullvar)
pt("item label does not exist");
label
(obj object, str/num label) Gets the node reference to an object's label Description Returns a reference to the specified labelnode on the given object.
The label parameter can be a label name or its rank. Example inc( label(item, "mylabel"), 5);
setlabel
(obj node, str/numlabel, num/str/node value) Sets the value of an object's label. Description Sets a label's value. The label parametercan either be the name of the label or its rank number. If the label does notalready exist, it will be added. Example setlabel(so(),"ProcessTime", 5) |