VEX questions?

   7028   6   2
User Avatar
Member
319 posts
Joined:
Offline
Is there a command in VEX which will output the contents of a variable to an output window for debugging purposes?

Also, how do you comment code in VEX? In the help it says use either // or /* */ but when I try either of these Houdini throws up an error! I'm trying to write a function in the Alias and Variables dialog. When I take the comment out, no error occurs so its not my code….

Thanks…..
User Avatar
Member
2199 posts
Joined: July 2005
Online
An expression written in expression and variables isn't vex it's a weird hscript C hybrid. Try using # for comments.
For debugging VEX use printf, for debugging hscript use message, or just set a global variable with setenv.
Not too sure about debugging expressions, maybe message works.
The trick is finding just the right hammer for every screw
User Avatar
Member
319 posts
Joined:
Offline
Hmm my tutor told us that the functions written in aliases and variables was VEX. Now I'm confused! If I want to write a piece of proper VEX code where do I do it? Do you have to write it as an external text file? If so, how do I reference the text file to use it as a function?
User Avatar
Member
2199 posts
Joined: July 2005
Online
You can write it in an external file - or go to file -> new operator type and select the apprioprate type, then select ok and it will bring up a dialog box, one of the tabs will be a vex one, you can add your own code in there.
The trick is finding just the right hammer for every screw
User Avatar
Member
166 posts
Joined: Feb. 2006
Offline
For debuging use
sprintf();

Have a look at the print OP in VEX and the help cause there is a special syntax to use if I remember correctly.
Time to get out of this messy world.
User Avatar
Member
2199 posts
Joined: July 2005
Online
printf() - prints to the console
sprintf() is for formating strings for use with variables, I believe.
Edited by - June 28, 2006 13:07:48
The trick is finding just the right hammer for every screw
User Avatar
Member
166 posts
Joined: Feb. 2006
Offline
True, my bad.
Time to get out of this messy world.
  • Quick Links