Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need to read map from file and print the map [DB Pro]

Author
Message
filya
18
Years of Service
User Offline
Joined: 23rd Aug 2006
Location: USA
Posted: 17th Apr 2007 03:06 Edited at: 17th Apr 2007 03:06
My code :



My map file :




1. I am unable to perform the read and print. I guess I have goofed up someplace. Could someone please help me find out my mistake?

2. How would I go about this, if instead of numbers in the map, I used characters? (say 'X' instead of '5' and a 'blank space' instead of '0')


Thank you very much for the anticipated help,

-filya

-- game dev is fun...but taking up too much time --
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Apr 2007 00:30
Try this:



TDK_Man

filya
18
Years of Service
User Offline
Joined: 23rd Aug 2006
Location: USA
Posted: 18th Apr 2007 00:50 Edited at: 18th Apr 2007 07:38
Thank you very much for your help TDK!

The thing works perfectly now. Thanks for pointing out my errors too!
Appreciate your quick help.


edit: For the 2nd part of my question, I guess I didn't convey my question correctly.
Actually it is :

If in the map file, I had characters 'X' and ' '(blank) in place of the numbers, how would the code to read the file be different now? I am not too sure how it should change to accomodate that since I would not want to use the 'val' to change the character to an integer and then use 'str$' to convert the integer back to a character.

-- game dev is fun...but taking up too much time --
Green7
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 3rd May 2007 23:50
yes, it would be nice if you could make the "map.txt" with letters instead of numbers, so you could get a bigger variety, as you got 24 letters instead of only 10 numbers...

Login to post a reply

Server time is: 2024-11-25 19:27:16
Your offset time is: 2024-11-25 19:27:16