docs.intersystems.com
MultiValue Quick Start Tutorial
MVBasic Example
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Search:    

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.


Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA