Re: Conversions

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

>
> Hello,
>         I'm trying to write a program and wanted to know a little more about
>       TYPE as in:

Type allows you to create a user defined variable type. I don't think it
is used to create structures.

However, one could argue successfully that the sequence is in fact already
a record structure. For example, look at this example code:

const x = 1
const y = 2
const z = 3
sequence rat
atom field_x, field_y, field_z

rat = {{100,100,100},
       {200,200,200},
       {300,300,300}}

field_x = rat[1][x]
field_y = rat[1][y]
field_z = rat[1][z]

This example code treats sequence rat just like a record, with constants
being used to define the fields. Notice that record 1's fields are being
accessed.

Hope this helps :)

David Gay
http://www.interlog.com/~moggie/Euphoria
"A Beginner's Guide To Euphoria"

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

Search



Quick Links

User menu

Not signed in.

Misc Menu