systemNameForID

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

systemNameForID

Post by Commander McLane »

Code: Select all

[script.javaScript.exception.notFunction]: ***** JavaScript exception (personalities 0.91): TypeError: system.systemNameForID is not a function
I had to change it to System.systemNameForID() to make it work. So, while we generally replace uppercases with lowercases, in this case I had to replace the lowercase with an uppercase.

Is this true for all static methods, because they are not applied to the specific current system, but to the general System object? (Sorry, I haven't yet gotten my head around the JS changes, therefore this may be the first in a series of dumb quiestions.)

If so, some small reminder on the Wiki page, just below the Static Methods headline would be nice, that starting from here uppercase System has to be used.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: systemNameForID

Post by Eric Walch »

Yes, it is true for all static methods. Ahruman already announced that here some time ago. But I agree that for someone like me, who never looked at this in detail, the difference between singleton and constructor is not immediately noticed. Partly because the used syntax is similar. And when in both cases the starting character could be both lower and upper case, there is also no correction mechanism in place.
So, a lot of current work is affected by this difference. :twisted:
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: systemNameForID

Post by Thargoid »

I think most of we scripters have fallen over this one, although in my case it was more so with Manifest/manifest (although there were some System/system ones too).

But if you look at the wiki page, the static examples for System do list it with a capital letter. But I guess a note to say it twice will also not hurt.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: systemNameForID

Post by Commander McLane »

Thargoid wrote:
But if you look at the wiki page, the static examples for System do list it with a capital letter.
True, but both are for infoForSystem, so perhaps I tricked myself into thinking that only this one needed an 'S'.

BTW, also the example for info (under properties) is capitalized ('System.info.description'). Is this correct?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: systemNameForID

Post by JensAyton »

Commander McLane wrote:
BTW, also the example for info (under properties) is capitalized ('System.info.description'). Is this correct?
Nope. (Fixed.)
Post Reply