ThomasPara Posted December 5, 2016 Share Posted December 5, 2016 Hi odforce when i create a string in vex with the @ sing it becomes _bound_ ex s@text = "@variable" becomes "_bound_variable" if i use the "create attribute" sop it gets correct How can i get it to become "@variable" instead in vex? Quote Link to comment Share on other sites More sharing options...
acey195 Posted December 5, 2016 Share Posted December 5, 2016 I think using "@" in VEX in a string is probably sort of impossible unfortunately. I would recommend using an attrib create or maybe python. Quote Link to comment Share on other sites More sharing options...
Skybar Posted December 5, 2016 Share Posted December 5, 2016 Seems to work if you create the attribute as string @text and not s@text. Ie: string @text = "@variable"; Not exactly sure what the difference is though. Quote Link to comment Share on other sites More sharing options...
acey195 Posted December 5, 2016 Share Posted December 5, 2016 3 minutes ago, Skybar said: Seems to work if you create the attribute as string @text and not s@text. Ie: string @text = "@variable"; Not exactly sure what the difference is though. hmm yeah interesting indeed I guess it has to do with initialized attributes possibly Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 5, 2016 Share Posted December 5, 2016 On 8/2/2016 at 1:35 PM, f1480187 said: Try unicode representation of the @ character: "\x40Cd.x<1.0". Snippet parser substitutes any "@" character with string "_bound_", it does not check if the symbol resides inside string. If you dive inside asset you may see this string by looking inside Attribute VOP's generated VEX code: "_bound_Cd.x<1.0". Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted December 5, 2016 Author Share Posted December 5, 2016 thx for the quick reply. But has it allways been like this, because in the helpfile on ex: the pcfind it says that you can use a string as an expression instead of group. This doesnt work when @ becomes _bound_. But if you cast it like you said it works. And im pretty sure i have used this functionality before. Also casting it as "String ptgroup" doesnt work either " The ptgroup is a point group that limits the points to search. This is a SOP-style group pattern, so can be something like 0-10 or @Cd.x>0.5. A blank string is treated as matching all points." So for future reference, if you want to use custom group in pcfind string @ptgroup = "@Cd.x>0.5"; //@Cd.r doesnt work, but @Cd.1 does int findpoints[] = pcfind(0,@ptgroup,"P",10,10); Quote Link to comment Share on other sites More sharing options...
Skybar Posted December 5, 2016 Share Posted December 5, 2016 I think it has something to do with the automatic binding. If you check the "Enforce Prototypes" it won't let you do 's@text' at all and throws an error. So you have to do 'string @text' to bind it properly. Since you already auto-bind with s@text, it probably expects to auto-bind "@variable" as well even though it's a string. Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 5, 2016 Share Posted December 5, 2016 (edited) Help is talking about VEX. It is fine to use "@" inside pure VEX code, for example in .vfl file. Snippet functionality does additional work on top of simply running VEX, including searching for "@" symbols in code - they do not appear in generated VEX code. Until it fixed, use "\x40" character escape sequence instead. Edited December 5, 2016 by f1480187 1 Quote Link to comment Share on other sites More sharing options...
GeordieM Posted October 19, 2018 Share Posted October 19, 2018 Just stumbled onto this problem. The help for VEX functions using SOP group syntax needs to be way more clear. From tooling around using \@ instead of \x40 seems to also work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.