Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Any reason we can't use other punctuation in variable names?

Evan_ReeseEvan_Reese Member Posts: 1,420 PRO
I'm trying to set up some variables for common hardware we have, and most of the item names contain things like "M1.2" or "1/4-20". I don't like using "M1_2" and "1_4_20" instead. Is there any chance of that becoming possible with a future update, or is it fundamentally a bad idea for some reason I can't see?
Evan Reese / Principal and Industrial Designer with Ovyl
Website: ovyl.io

Answers

  • S1monS1mon Member Posts: 883 PRO
    I don't know the true answer to this, but in general, writing parsers for computer languages is tricky if you add in things that could be interpreted as part of an equation. That said, some languages these days allow all kinds of emoji and goofiness in variable names, so perhaps there would be a way to put in some characters that look like what you want, but wouldn't be interpreted as math.
  • Evan_ReeseEvan_Reese Member Posts: 1,420 PRO
    Thanks for the rundown @kevin_o_toole_1
    I definitely get the ambiguity of the "1/4-20" example. It would still be really handy to me to be able to do "M1.6" which I don't see as having the same issue. I also get that it would be unconventional to allow a decimal point as compared to other languages, but maybe it makes sense for Featurescript to break that convention. Of course, I'm far from qualified to say for sure, but it would help me in this particular instance.

    I also didn't know that about the invalid names. So you could use that, for example, to create some features that are meant to be used in sequence and they could pass some data around without exposing it to the end user?
    Evan Reese / Principal and Industrial Designer with Ovyl
    Website: ovyl.io
Sign In or Register to comment.