Newbie Question1

Newbie Question1 - Messages

#1 Posted: 3/16/2016 5:18:33 AM
frapuano

frapuano

13 likes in 115 posts.

Group: User

Hi,

as usually a simple question.
I want to define on the canvas a variable whose name is 1stPosition and inizialize its value to 1 .
What I would like to knwow is if it is by design that I achieve this ...

sshot-1.png


so it is always added a unit of measure when I enter with the keyboard s or S , so after this happens I need to delete what has been added and this continue to happen as I key as text something that is a predefined unit ..at least is what I see.
I am using the last night build.

Best regards

Franco
#2 Posted: 3/16/2016 6:32:22 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Yes it is by design; a variable name cannot start with a number.

2016-03-16 10_28_27-SMath Studio Desktop - [Page1_].png

This is a standard almost everywhere (there are few exceptions); it keeps consistent and fast how to identify a variable both for humans and for the core (because you have to check only the first character).

You can use p1, pos1, Position1st, ...

If you define a variable with the same name of a unit, the variable s shown as first in the dynamic assistance, otherwise you have to type at least another character (if there is a 1-character unit or function already defined)

2016-03-16 10_34_35-SMath Studio Desktop - [Page1_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 3/16/2016 8:02:09 AM
frapuano

frapuano

13 likes in 115 posts.

Group: User

Davide

Thanks a lot for your feedback , now it is clear and I will follow your suggestions for the future variables naming .
The only thing that doesn't fit well is that on my Smath when I write the same as you ( so 12345 equal something ) ..I do not see the error description as shown in your screen shot.

Best regards

Franco
#4 Posted: 3/16/2016 9:57:41 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Wrote

The only thing that doesn't fit well is that on my Smath when I write the same as you ( so 12345 equal something ) ..I do not see the error description as shown in your screen shot.


It appears when you press F9.
Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Davide Carpi 3/16/2016 2:31:00 PM
#5 Posted: 3/16/2016 11:14:07 AM
frapuano

frapuano

13 likes in 115 posts.

Group: User

Shame on me ...
1 users liked this post
Davide Carpi 3/16/2016 2:30:00 PM
#6 Posted: 3/16/2016 3:16:32 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User


Forum Var Numeric.gif
1 users liked this post
frapuano 3/16/2016 5:13:00 PM
  • New Posts New Posts
  • No New Posts No New Posts