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.
Article Q84062, Example
◄Contents► ◄Index► ◄Back►
─────────────────────────────────────────────────────────────────────────────
◄Knowledge Base Contents► ◄Knowledge Base Index►
VB for MS-DOS: How to Append Data to the End of an .EXE File - Q84062
The following is a small program that will create a data file
containing a graphics image created with the PRINT and LINE statements
in Basic:
' To try this example in VBDOS.EXE:
' 1. From the File menu, choose New Project.
' 2. Copy the code example to the Code window.
' 3. Press F5 to run the program.
SCREEN 12
COLOR 1 ' Select Blue for the color.
DIM box%(1 TO 1792) ' Dimension an array big enough for the GET
' statement.
LOCATE 2, 2 ' Locate the "Hello" text.
PRINT "Hello";
LINE (1, 15)-(55, 30), , B ' Draw a box.
GET (1, 1)-(55, 30), box% ' Get the box.
OPEN "DATAFILE" FOR BINARY AS #1
FOR i% = 1 TO 1792
PUT #1, , box%(i%) ' Save image to disk.
NEXT i%
CLOSE #1
END