Skip to main content

MVBasic Example

Here is an example of an MVBasic routine that opens PERSON and displays the information for the record with Id 2:


OPEN "PERSON" TO PERSON.FILE ELSE PRINT "PERSON NOT OPEN"
READ PERSON.ITEM FROM PERSON.FILE,2
PRINT "NAME: ":PERSON.ITEM<3>
PRINT "HAIR: ":PERSON.ITEM<2>
PRINT "AGE: ":PERSON.ITEM<1>
PRINT "PHONES:"
FOR I=1 TO DCOUNT(PERSON.ITEM<4>,@VM)
PRINT PERSON.ITEM<4,I>
NEXT I
END   

Note that MVBasic uses the standard <> syntax for accessing dynamic array elements.

FeedbackOpens in a new tab