home *** CD-ROM | disk | FTP | other *** search
- /* ---------------------------------------------------------------
- Example of just reading a file, without the clutter
- * --------------------------------------------------------------- */
-
- /* ------------------- Record Layout String --------------------- */
-
- videorecord = " videonum videotitle videocopy videorating videopudate,
- videopuprice videosaleprice videoavail videohold videocust"
-
- x = addlib("RexxRMF.library",0,-30,0) /* --- make library available --- */
-
- rmfvideos = open_rmf("videofile") /* open file */
-
- vidnode = find_pos(rmfvideos,0,1) /* get first video record */
-
- videonum = key_value(vidnode) /* get key value to use in read */
-
- /* read the first record, looking for unique keys only */
- /* variable names in all caps are from videorecord */
-
- x = read_rmf_record(rmfvideos,0,videorecord,videonum,'U',1)
-
- do while x = 1 /* read rcords */
-
- /* how many videos we got with this key */
- count = key_count(rmfvideos,0,VIDEONUM,'K')
-
- /* display record contents */
-
- call writech(stdout,'0c'x)
- call writeln(stdout,'0a'x" Video#:" VIDEONUM " Copies:" count)
- title = substr(VIDEOTITLE,1,32,' ')
- call writech(stdout," Title :")
- call writeln(stdout,title "Copy#:"VIDEOCOPY "Rating:" VIDEORATING)
- call writeln(stdout," Date Purchased:"VIDEOPUDATE)
- call writeln(stdout," Purchase Price:"VIDEOPUPRICE)
- call writeln(stdout," Sale Price :"VIDEOSALEPRICE)
- call writeln(stdout," Available :"VIDEOAVAIL)
- call writeln(stdout," Hold For :"VIDEOHOLD)
- call writeln(stdout," Current Renter:"VIDEOCUST)
-
- call writech(stdout, '0a'x "More... ([Y]/N) ?")
- z = readln(stdin)
- if upper(substr(z,1,1)) = 'N' then leave
-
- /* read the next record, will terminate loop if not found */
- /* variable names in videorecord are set */
-
- x = next_rmf_record(rmfvideos,0,videorecord)
-
- end
-
- x = close_rmf(rmfvideos,1) /* the '1' says do not save the data/index files */
-
- exit
-