Print Topic - Archive
XBLite Forum / XBLite Programming / Multilines Macros
Posted by: 26 (Guest), August 3, 2008, 11:29am
I saw some in DX examples but i am unable to write by my own.Could someone show me how to write correctly multilines macros with this monoline example ?
Quoted Text
m4_define(`MATH_VECTOR_Bezier',`$5.x=MATH_INT_Bezier($1.x,$2.x,$3.x,$4) : $5.y=MATH_INT_Bezier($1.y,$2.y,$3.y,$4) : $5.z=MATH_INT_Bezier($1.z,$2.z,$3.z,$4)')
Posted by: XBLiteAdmin, August 3, 2008, 1:40pm; Reply: 1
CONSOLE
IMPORT "xst"
DECLARE FUNCTION Entry ()
m4_define(`SUMx',`x = x + $1'
`x = x + $2'
`x = x + $3')
FUNCTION Entry ()
x = 100
SUMx(5, 6, 7)
? x
a$ = INLINE$ ("Press Enter to quit >")
END FUNCTION
END PROGRAM
Posted by: 26 (Guest), August 28, 2008, 11:30am; Reply: 2
Sorry but i still in pain, i tried to convert this one that works perfectly:
Quoted Text
m4_define(`GetElapsedMs',`QueryPerformanceCounter(&$2):QueryPerformanceFrequency(&$3):$2=($2-$1)*1000:$4=SINGLE($2)/SINGLE($3)')
for this one :
Quoted Text
m4_define(`GetElapsedMs',`QueryPerformanceCounter(&$2)'
`QueryPerformanceFrequency(&$3)'
`$2=($2-$1)*1000'
`$4=SINGLE($2)/SINGLE($3)')
but i still get a load of errors.It is located on a file imported with m4_include but i tried to put it in the main file and i have the same errors
Posted by: XBLiteAdmin, August 31, 2008, 12:31am; Reply: 3
This looks like it works:
Quoted Text
m4_define(`GetElapsedMs',`QueryPerformanceCounter(&$2)
QueryPerformanceFrequency(&$3)
$2=($2-$1)*1000
$4=SINGLE($2)/SINGLE($3)')
Posted by: 26 (Guest), August 31, 2008, 10:19am; Reply: 4
Finally works :) thanks a lot !
Print page generated: February 5, 2012, 2:43pm