Code: Select all
class c{
■:=1 ;Expected assignment or class/method definition. only in V1.
;Perhaps it should be "Invalid class variable declaration." (which occur when variable name "/a")
a■:=2 ;Same error
}
■:=3 ;fine
a■:=4 ;fine
Code: Select all
class c{
■:=1 ;Expected assignment or class/method definition. only in V1.
;Perhaps it should be "Invalid class variable declaration." (which occur when variable name "/a")
a■:=2 ;Same error
}
■:=3 ;fine
a■:=4 ;fine
No; class variable names must be alphanumeric/underscore in v1.I think the rule of variable name are the same as class variable as normal variable.
That only occurs for the static keyword, followed by a space or tab, but then not followed by a valid variable declaration. It has nothing to do with the name."Invalid class variable declaration." (which occur when variable name "/a")
Code: Select all
class c{
/a := 1 ; This becomes a continuation of the previous line due to the /.
}
/*
Error: Missing "{"
Specifically: c{ /a := 1
Code: Select all
class c{
a:=1,
/b:=1 ;Invalid class variable declaration.
}
Code: Select all
Specifically: c{ /a := 1
Ah yes, in this case the "line" begins with a:=1,. If you hadn't put the comma at the end, you would not have got an error message. It would have been equivalent to this:Exception about "Invalid class variable declaration.":
Code: Select all
a:=1/b:=2 ; b is a global var in this case, and a receives the value 0.5 (1/2).
Users browsing this forum: Cicin and 17 guests