Difference between revisions of "User Frame"
(→PROTO.PRO) |
(→Return Value) |
||
Line 20: | Line 20: | ||
== Return Value == | == Return Value == | ||
Anything except 0 is an error code. | Anything except 0 is an error code. | ||
+ | |||
+ | |||
+ | ==Example== | ||
+ | |||
+ | ===Library definition: === | ||
+ | <pre> | ||
+ | IMPORT_C RBT_TABLE(byval as generic location,byval as generic location,byval as generic location, as generic location ) as long | ||
+ | |||
+ | public function Table(byval a as generic location,byval b as generic location,byval c as generic location) as generic location | ||
+ | dim tmp as long | ||
+ | dim x as generic location | ||
+ | tmp = rbt_table(a,b,c,x) | ||
+ | if tmp then | ||
+ | Print "Internal TABLE error",tmp | ||
+ | end if | ||
+ | Table = x | ||
+ | end function | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | ===Usage=== | ||
+ | |||
+ | <pre> | ||
+ | dim shared Xax as location of xyzypr = #{10,0,0,0,0,0} | ||
+ | dim shared Yax as location of xyzypr = #{0,10,0,0,0,0} | ||
+ | dim shared Zax as location of xyzypr = #{0,0,10,0,0,0} | ||
+ | |||
+ | dim shared Origin as location of xyzypr = #{10,20,30,0,0,0} | ||
+ | |||
+ | program | ||
+ | |||
+ | dim MyFrame as location of xyzypr | ||
+ | dim Res as generic location | ||
+ | |||
+ | |||
+ | MyFrame = Origin:#{0,0,0,45,45,45} | ||
+ | Print "MyFrame : ";Myframe | ||
+ | Res = Table(Origin,MyFrame:Xax,MyFrame:Yax) | ||
+ | |||
+ | Print "Res : ";res | ||
+ | |||
+ | end program | ||
+ | </pre> | ||
+ | |||
+ | Output: | ||
+ | <pre> | ||
+ | MyFrame : #{10 , 20 , 30 , 45 , 45 , 45} | ||
+ | Res : #{10 , 20 , 30 , 45 , 45 , 45} | ||
+ | </pre> |
Revision as of 13:33, 24 December 2015
Contents
User Frame
User can add his own frame by teaching three points: A, B, C
PROTO.PRO
New function must be defined in the PROTO,PRO file as:
IMPORT_C RBT_TABLE(byval as generic location, byval as generic location, byval as generic location, as generic location ) as long
Usage
Calling:
-->?RBT_TABLE(A,B,C,D)
Return Value
Anything except 0 is an error code.
Example
Library definition:
IMPORT_C RBT_TABLE(byval as generic location,byval as generic location,byval as generic location, as generic location ) as long public function Table(byval a as generic location,byval b as generic location,byval c as generic location) as generic location dim tmp as long dim x as generic location tmp = rbt_table(a,b,c,x) if tmp then Print "Internal TABLE error",tmp end if Table = x end function
Usage
dim shared Xax as location of xyzypr = #{10,0,0,0,0,0} dim shared Yax as location of xyzypr = #{0,10,0,0,0,0} dim shared Zax as location of xyzypr = #{0,0,10,0,0,0} dim shared Origin as location of xyzypr = #{10,20,30,0,0,0} program dim MyFrame as location of xyzypr dim Res as generic location MyFrame = Origin:#{0,0,0,45,45,45} Print "MyFrame : ";Myframe Res = Table(Origin,MyFrame:Xax,MyFrame:Yax) Print "Res : ";res end program
Output:
MyFrame : #{10 , 20 , 30 , 45 , 45 , 45} Res : #{10 , 20 , 30 , 45 , 45 , 45}