File: dxall547

package info (click to toggle)
dx 1%3A4.4.0-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 51,684 kB
  • ctags: 48,796
  • sloc: ansic: 365,033; cpp: 156,603; sh: 13,395; java: 10,374; makefile: 2,377; awk: 444; yacc: 327; cs: 49
file content (27 lines) | stat: -rw-r--r-- 1,921 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!F-adobe-helvetica-medium-r-normal--18*
#!N 
#!CSeaGreen  #!Rall546 Macro Examples #!N #!EC #!N #!N The first 
example macro, Sum, takes two arguments. The macro computes and returns 
their sum. #!CForestGreen #!N #!N  #!F-adobe-courier-bold-r-normal--18*   #!N macro Sum (arg1, arg2) 
-> (sum) #!N { #!N sum = arg1 + arg2; #!N 
} #!EF #!N #!N #!EC #!N #!N The second example macro, 
PrintSum, also takes two arguments and computes their sum. However, unlike 
the macro Sum, it does not return the computed value. Instead, 
it prints out using the Echo module. This example illustrates a 
function call (to Echo) that either does not return a value 
or whose return values are ignored. #!N #!N #!CForestGreen #!N  #!F-adobe-courier-bold-r-normal--18*   
#!N macro PrintSum (arg1, arg2) #!N { #!N sum = arg1 
+ arg2; #!N Echo (sum); #!N } #!EF #!N #!N #!EC 
#!N #!N The third example macro, VectorManip, implements a function to 
compute the cross product, dot product, and cosine of two 3-vectors. 
Note that the returned values do not need to be computed 
in the order in which they are declared. #!N #!N #!CForestGreen 
#!N  #!F-adobe-courier-bold-r-normal--18*   #!N macro VectorManip (vectlist1, vectlist2) -> (dot, cross, cos) 
#!N { #!N cross = Compute("cross($0, $1)", vectlist1, vectlist2); #!N dot 
= Compute("dot($0, $1)", vectlist1, vectlist2); #!N cos = Compute("$0/(mag($1)/mag($2))", dot, vectlist1, 
vectlist2); #!N } #!EF #!N #!N #!EC #!N #!N Note that 
the Data Explorer script language does not allow nested function calls. 
The following example illustrates a syntactically invalid function call: #!CForestGreen #!N 
#!N  #!F-adobe-courier-bold-r-normal--18*   #!N Echo ( Sum (arg1, arg2) ); #!EF #!N 
#!N #!EC #!N #!N #!N  #!F-adobe-times-medium-i-normal--18*   Next Topic #!EF #!N #!N 
 #!Lsdxsc,dxall548 h Using Data Explorer Script Commands  #!EL  #!N  #!F-adobe-times-medium-i-normal--18*   #!N