Page 1 of 1
[Implemented] Define multiple Dim and NewList in a row.
Posted: Mon Jan 08, 2007 8:59 pm
by Flype
Just a small request - for consistency.
it is possible to define multiples variables in one line.
so it might be possible to define Dim and NewList in the same way, isn't it ?
Code: Select all
Define Var1.l, Var2.f, Var3.s ; possible
NewList List1.l(), List2.f(), List3.s() ; not possible
Dim Array1.l(1), Array2.f(1), Array3.f(1) ; not possible
Posted: Mon Jan 08, 2007 9:27 pm
by Psychophanta
Very logical.
I strongly second that!
Posted: Mon Jan 08, 2007 9:46 pm
by Num3
Ditto

Posted: Mon Jan 08, 2007 9:59 pm
by Psychophanta
However, it would be confussion when adding Global, Shared, Static or Protected words before NewList or Dim words.
BTW, why doesn't work:

Posted: Mon Jan 08, 2007 10:33 pm
by freak
Psychophanta wrote:BTW, why doesn't work:

because it makes no sense

"Global" implies a definition of the variable, adding another "Define" is overkill.
Actially, this one allready works:
It would make sense to allow the same syntax for Define as well.
Posted: Mon Jan 08, 2007 11:41 pm
by jear
BTW...
but
causes a syntax error!
Posted: Tue Jan 09, 2007 12:24 am
by Flype
freak wrote:Actially, this one allready works:
It would make sense to allow the same syntax for Define as well.
Ha yes, good. Thank you for the tip freak.
So at the moment we have :
Global, Protected, Static -> allow multiples.
Define, Shared -> do not allow multiples.
Posted: Tue Jan 09, 2007 12:29 am
by Flype
jear wrote:BTW...
but
causes a syntax error!
i think it is normal !
because 'Define.s' can be used alone to 'preset' all futured variables as .s
Code: Select all
Define.s
a = "a" ; this is a string.
b = "b" ; this is a string.
but 'Global' can't be used this way (and Protected, Shared, Static).
Posted: Tue Jan 09, 2007 8:55 am
by Chrono Syndrome
Great idea !
Posted: Tue Jan 09, 2007 11:02 am
by Derek
Makes sense to have more than one DIM on a line.
Posted: Tue Jan 09, 2007 12:17 pm
by jear
because 'Define.s' can be used alone to 'preset' all futured variables as .s
Code: Select all
EnableExplicit
Define.s
a = "a" ; this is a string.
b = "b" ; this is a string.
???