bas7ex.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
BSAVE and GET Programming Example
                       Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
'This example draws a magenta cube inside a white box and then uses the BSAVE
'statement to store the drawing in the file MAGCUBE.GRH. The BLOAD statement
'example program shows how you can retrieve and display the drawing.
 
DIM Cube(1 TO 675)
SCREEN 1
'Draw a white box.
LINE (140, 25)-(140 + 100, 125), 3, B
'Draw the outline of a magenta cube inside the box.
DRAW "C2 BM140,50 M+50,-25 M+50,25 M-50,25"
DRAW "M-50,-25 M+0,50 M+50,25 M+50,-25 M+0,-50 BM190,75 M+0,50"
'Save the drawing in the array Cube.
GET (140, 25)-(240, 125), Cube
'Set segment to the array Cube's segment and store the drawing
'in the file MAGCUBE.GRH. Note: 2700 is the number of bytes
'in Cube (4 bytes per array element * 675).
DEF SEG = VARSEG(Cube(1))
BSAVE "MAGCUBE.GRH", VARPTR(Cube(1)), 2700
DEF SEG                 'Restore default BASIC segment.