The following example has been compiled and run successfully. The next step is to implement nested structures.
Code: Select all
' SharpBASIC structure 1
' ----------------------
incl "lib/sys.sbi";
struc SPerson is
  fname: str;
  sname: str;
  dname: str;
  age: uint;
end
dim person: SPerson;
dim size: uint;
main do
  person.fname = "John ";
  person.sname = "Smith";
  person.dname = person.fname + person.sname;
  print(person.dname);
  person.age = 53;
  print(person.age);
  size = len(person);
  print(size);
end