Page 1 of 1

Names for Enumerations?

Posted: Thu Oct 23, 2008 11:05 am
by NicTheQuick
What about setting names to enumerations?

Code: Select all

Enumeration Foo
  #hello
  #there
EndEnumeration

Debug Foo\#hello
Debug Foo\#there
But I don't no it's useful to use '#' furthermore.

Another idea is to make it like the following code:

Code: Select all

Enumeration Foo
  #hello
  #there
EndEnumeration

Debug #Foo_hello
Debug #Foo_there

Posted: Thu Oct 23, 2008 11:57 am
by IceSoft
Why?

Posted: Thu Oct 23, 2008 12:05 pm
by srod
Your second example is no different to :

Code: Select all

Enumeration
  #Foo_hello 
  #Foo_there 
EndEnumeration 

Debug #Foo_hello 
Debug #Foo_there 
Your first notion seems to be heading towards the VB style of enumeration which is a typed variable rather than a simple listing of constants. Personally I have never really seen the point of the VB enumerated type. Perhaps that's just me though! :) However, mixing the VB type with PB's use of the enumeration to assist with constants is pretty much a non-goer I reckon!

Beside's, any alteration to the Enumeration / EndEnumeration compiler construct will kill just about every program I have ever written and I will in turn kill whoever is responsible for such an alteration!!! :wink:

Posted: Thu Oct 23, 2008 12:07 pm
by ts-soft
Good idea, but only with compilercheck of parameter:

Code: Select all

Enumeration Foo
  #hello
  #there
EndEnumeration

Debug Foo\#hello
Debug Foo\#there

Procedure bla(first.Foo, second.l)

EndProcedure

Posted: Thu Oct 23, 2008 1:30 pm
by Kaeru Gaman
Another Problem: Enumeration already HAS arguments.

Code: Select all

Enumeration [<constant> [Step <constant>]]