No number Names?

Discussion and feedback on Construct 2

Post » Mon Apr 23, 2012 7:38 pm

Hey i am wondering why i can't call Objects and Variables numbers?

Example: I can call a Sprite 001a but not simply 001.

And Variables can't be called numbers at all...

Why is that?


Was thinking of working on a -Save -Load mechanism similar to WC3 Orpg Maps.


Link
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Mon Apr 23, 2012 7:50 pm

because numbers are viewed differently by the computer when accessing things. Its always been bad programming to use numbers at the beginning of names if at all.
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Tue Apr 24, 2012 12:00 am

set X to 001 * 1

Am I referring to the variable or the number? Who knows...
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue Apr 24, 2012 12:13 am

Sqiddster's correct :) It's to remove ambiguity. Naming something as a number is also probably bad practise as it's not very descriptive
Image Image
Scirra Founder
B
125
S
37
G
25
Posts: 3,945
Reputation: 44,922

Post » Tue Apr 24, 2012 6:04 pm

This is the same as any scripting or programming language you'll ever use. Names cannot be numbers - if you name an object "1", how does the parser understand 1 + 1? :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Tue Apr 24, 2012 9:30 pm

@Ashley

Yeah that was my only problem with the idea 2 ^^

But i figured.. you knoooow.. Wing it xD


Thx for replies ^^

It doesn't matter at the moment anyway, I have all hands full learning Blender at the Moment :)
B
40
S
11
G
4
Posts: 665
Reputation: 8,403


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests