Arrays and Lists of newtypes
 

Just as variables which used newtypes were the same as variables which used the basic types, there is no difference between arrays and lists of newtypes and arrays and lists of the basic types. All the same rules apply from the original arrays and lists topic, and the rules about newtypes from the previous page should also be followed.

The only thing you need to know is the way fields are accessed in arrays and lists of newtypes. To do this, you use the 'arrayname\field' format, just as with variables, like this:

Code NEWTYPE.person
  name$                ; Person's name
  age.w                ; Their age in years
  height.q             ; Height in metres
  day.w : month : year ; Date of birth
End NEWTYPE

Dim foo.person(5)
Dim List bar.person(5)

foo(0)\name = "My name is foo"

AddItem bar()
bar()\age = 24


Previous: Explanation of newtypes Programming contents Next: Other useful newtype info


News | Introduction | Search | List/Forum/IRC Webring | Contact
Installation | Troubleshooting | Programming | Archives | Links
Return to home page
Page last modified: 14th September 2001