Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

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.

Feedback