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 / txt files to array

Author
Message
catman
18
Years of Service
User Offline
Joined: 10th Dec 2005
Location:
Posted: 2nd Jan 2006 22:49
thanks grog got the array thing now.But need help an a different approch what i want to do is load a txt file e.g

**********
****//****
**********

and read the info to create a hight map for a matrix i have downloaded some examples but cant realy grasp it could somebody
help
UFO
19
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 3rd Jan 2006 00:34 Edited at: 3rd Jan 2006 00:40
You could use read byte, and it will only read one character, and then you will want to use variable = chr$(variable) to turn it into the character instead of like, 25.
Example (not tested):

I'm not sure if it counts carrage return or not. If it does, find the ascii code for it and add an if statement with the

lines within it.

Good luck!


Hippopotomonstrosesquippedaliophobia-Fear of long words
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Jan 2006 07:02
Quote: "**********
****//****
**********"


Is that the height map you want to use? What character = what height? Is it based on the ascii chart?


crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 3rd Jan 2006 14:03 Edited at: 3rd Jan 2006 14:04
why use ascii.

using numbers or something would be better. Higher values.

heres 1 i use often

save:


load:


hope that helps


aye!
catman
18
Years of Service
User Offline
Joined: 10th Dec 2005
Location:
Posted: 3rd Jan 2006 20:24
cheers lads that will do nicely

Login to post a reply

Server time is: 2024-11-27 07:35:27
Your offset time is: 2024-11-27 07:35:27