Welcome, Guest.
Please login or register.
Multilines Macros
Forum Login
Login Name: Create a new account
Password:     Forgot password

XBLite Forum    General Boards    XBLite Programming  ›  Multilines Macros
Users Browsing Forum
No Members and 1 Guests

Multilines Macros  This thread currently has 2,098 views. Print Print Thread
1 Pages 1 Recommend Thread
26
August 3, 2008, 11:29am Report to Moderator Report to Moderator
Guest User
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)')
Logged
E-mail E-mail
XBLiteAdmin
August 3, 2008, 1:40pm Report to Moderator Report to Moderator
Administrator Group
Posts: 44
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
Logged Offline
Site Site Private Message Private message Reply: 1 - 4
26
August 28, 2008, 11:30am Report to Moderator Report to Moderator
Guest User
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
Logged
E-mail E-mail Reply: 2 - 4
XBLiteAdmin
August 31, 2008, 12:31am Report to Moderator Report to Moderator
Administrator Group
Posts: 44
This looks like it works:

Quoted Text
m4_define(`GetElapsedMs',`QueryPerformanceCounter(&$2)
QueryPerformanceFrequency(&$3)
$2=($2-$1)*1000
$4=SINGLE($2)/SINGLE($3)')
Logged Offline
Site Site Private Message Private message Reply: 3 - 4
26
August 31, 2008, 10:19am Report to Moderator Report to Moderator
Guest User
Finally works   thanks a lot !
Logged
E-mail E-mail Reply: 4 - 4
1 Pages 1 Recommend Thread
Print Print Thread

XBLite Forum    General Boards    XBLite Programming  ›  Multilines Macros

Thread Rating
There is currently no rating for this thread