Re: Euphoria vs. C and OOP

new topic     » goto parent     » topic index » view thread      » older message » newer message

jacques deschĂȘnes wrote:

> The only addition would be enum declaration
> enum  {first_name, last_name, street, town}
> sequence addresse
> address = repeat(0,5)
> address[first_name] = "Don"
> address[last_name] = "Cole"
> etc...
> this would reduce typing compared to 
> constant first_name=1, last_name=2, town=3
> and those enum could only be used to access sequence elements

Or something like this:

newSequence("addresse")   -- newDatabase
define_elements(          -- define_fields
   "addresse" ,
   {
      "name_first",
      "name_last",
      "street",
      "town"
   }
)

set("addresse","name_first","Don")
set("addresse","name_last","Cole")

That's a simple example and makes the code infinitely flexible.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu