PDA

Click to See Complete Forum and Search --> : Maps


Spie
Aug 20th, 2000, 05:51 PM
How do I create a map file? I need to stop a picture from going off the form... do i need a special program to do that?

SteveCRM
Aug 20th, 2000, 09:13 PM
Oh boy, this will be a long thread. You need to store the map in a 2d array. And then I guess just save the array as .map

kedaman
Aug 21st, 2000, 03:06 AM
Yeah, that's what i think Steve, ok let's start from the beginning...

For the map, you declare the width, the height and the map array

private height as integer
private width as integer
Map() as byte

The map array is now dynamic so that you can change the size of it anytime:

height=30
width=30
redim map(width,height)

To store this array you open the file in binary

Open Filename for Binary as #
Put#1,,width
Put#1,,height
Put#1,,map
Close 1

And to read it again you use Get isntead of put

Open Filename for Binary as #
Get#1,,width
Get#1,,height
Redim map(width,height)
Get#1,,map
Close 1