Difference between revisions of "VS:EvalStr"

From Vectorworks Developer
Jump to: navigation, search
m (1 revision)
(add remark about brakets)
 
Line 47: Line 47:
 
<code lang="pas">
 
<code lang="pas">
 
dataValue:= EvalStr(handleToObject,('Part Info'.'Serial No.'));</code>
 
dataValue:= EvalStr(handleToObject,('Part Info'.'Serial No.'));</code>
 +
 
==== Python ====
 
==== Python ====
 
<code lang="py">
 
<code lang="py">
Line 52: Line 53:
 
</code>
 
</code>
 
</sample>
 
</sample>
 +
 +
-----------------------------------------------------------------------------------------------------------
 +
<remark>
 +
([[User:Orso.b.schmid|Orso]], 2015.06.17):
 +
Don't forget the brakets or it will block the rest of the script in a totally unpredictable way upon any special char. I suppose that it tries to parse the rest of the script as criteria:
 +
crit := '.'; { suspiciously dangerous special char }
 +
str := EvalStr(gTargetH, crit); { strange failure of parts of the script after this call ! }
 +
str := EvalStr(gTargetH, (crit)); { correct }
 +
</remark>
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------

Latest revision as of 01:40, 17 June 2015

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Evaluates whether an object meets the specified search criteria.

When used with record criteria, it will determine whether a specific record is attached to the object; if used with record-field criteria, it will return the value of the field as a STRING.

FUNCTION EvalStr(
h  :HANDLE;
c  :CRITERIA) : STRING;
def vs.EvalStr(h, c):
    return STRING

Parameters

h HANDLE Handle of object to which the search criteria will be applied.
c CRITERIA Search criteria.

Return Value

If the criteria is a record-field criteria, the procedure will return the value contained within the field. All other criteria return the TRUE-FALSE state of the criteria condition.

Remarks

(Orso, 2015.06.17):

Don't forget the brakets or it will block the rest of the script in a totally unpredictable way upon any special char. I suppose that it tries to parse the rest of the script as criteria:

crit := '.'; { suspiciously dangerous special char }
str := EvalStr(gTargetH, crit); { strange failure of parts of the script after this call ! }
str := EvalStr(gTargetH, (crit)); { correct }

Example

VectorScript

dataValue:= EvalStr(handleToObject,('Part Info'.'Serial No.'));

Python


Version

Availability: from All Versions
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox