Jump to content

VEX: #pragma disable


Magnus Pettersson

Recommended Posts

Hello!

Im new in VEX but i have written my tool now but in the UI i want to disable a parameter "globalRadius" when a string attribute "radiusAttr" is not empty. So when radiusAttr has something written into it, it should be greyed out, how do i write this?... I just did a test vop and looked at its vex code and i got this code:

#pragma disable globalRadius radiusAttr != ""

but when i write it in my vex node otl it does not work, the attribute is disabled all the time instead! How do i do this?

.. oh while im at it, on a side note, when defining arrays i must zero them out first like: float myArray[] = {0,0,0,0,0} or else i get wierd results.. but how do i zero out an array that has varying length? do i need to loop it with a foreach to make a initialized zeroed array or is there something i missed? :D

thanks for your help

/Magnus

Link to comment
Share on other sites

Hey Magnus, do something like:

#pragma disable globalRadius radiusAttr "none"

As for your array question, where are you declaring your arrays?

-Rick

Hey Rick! when i declare it like that i will only disable globalRadius when radiusAttr is "none".. or whatever i now set the string as, and like that i have got it to work before. but in my case i want it to be disabled when its NOT none .. or NOT "" ie when its not a empty string it should be disabled, and when its empty string it should be enabled :) its how i declare the NOT that i have problem with the != sign that i can write in the normal vop "disable when" ... and that i actually got as vex code when i right clicked a test vop i made and looked at the code generated, but it does not work when i write it in my vex node or other test nodes i made so maybe its just special for vop? i thought it should be an easy thing to do compared to the actual tool but now its finished and what im struggling with is these small formality things ;P

About the Array, Im not at work now so I cant check but im 99% sure i declare the array in the main function, i use it to store all the distance from all points in a pointcloud and when im not zeroing the array out i get trash values, i remember reading in the VEX manual something about it too, but it does not say how to fully zero out an array.. right now i just have it hardcoded with alot of zeroes in the { } brackets, not so elegant solution hehe!

/Magnus

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...