10.06.2016 Views

eldo_user

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Post-Processing Library<br />

defineVec<br />

defineVec<br />

Defines a PPL object using C-like syntax. Similar to the evalExpr command, defineVec enables<br />

evaluation of an expression written using C-like syntax but the result is stored in a PPL object<br />

named output_object rather than displayed. An error occurs if an object using the same name<br />

already exists in the PPL.<br />

Tip<br />

This command is more likely to be used with wave calculations, whereas the evalExpr<br />

command is for numerical expressions.<br />

Syntax<br />

defineVec expression<br />

Arguments<br />

• output_object<br />

Name of the object which contains the result of the expression.<br />

• expression<br />

Expression to be evaluated.<br />

Examples<br />

Example 1<br />

This function demonstrates the defineVec command. It produces the same results as the<br />

evalExpr function example and returns to Eldo a reference to the PPL object “vector” to plot it.<br />

proc DEFINE_VEC { wv_in } {<br />

# evalExpr using numbers<br />

set a 3<br />

defineVec numerical "2*$a+4"<br />

puts "numerical = [display numerical]"<br />

# evalExpr using waves (use display command to print vector values)<br />

defineVec vector "$wv_in+4"<br />

puts "vector = [display vector]"<br />

return vector<br />

}<br />

A call to this function from the Eldo command:<br />

.call_tcl tran when=END_OF_RUN PLOT=YES LABEL=Absv1 DEFINE_VEC(v(1))<br />

produces the same output as evalExpr but the object vector can be reused in any expression or<br />

returned to Eldo to be dumped in the output file.<br />

1146<br />

Eldo® User's Manual, 15.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!