Jump to content

how to get @ sign in string


Recommended Posts

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

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by f1480187
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

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...