' Collection of code snippets by Arne Vajhøj 
' (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
program p3

option type = explicit

record msgrectyp
    integer id
    string msg = 100
end record
map (msgrec) msgrectyp msg

! open database
open "msgs.isq" as file #1, indexed fixed, recordtype none, map msgrec, primary key msg::id duplicates
! write message to database
msg::id = 3
msg::msg = "Hi from Basic!"
put #1
! dump all messages in database
reset #1
handler eof_handler
end handler
when error use eof_handler
    while 1 = 1
        get #1
        print using "'E", "|" + msg::msg + "|"
    next
end when
! close database
close #1

end program
