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.

DarkBASIC Discussion / lOOk before my head explodes!!!!

Author
Message
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 23rd Nov 2002 18:42
right then thanks for looking,

situation:

i have a .txt file with the folowing paramaters in:

1,0,5,3
2,0,3,3
3,1,3,2
.

the first on is the object nuber the second is transparency 3rd= ? 4th= something else.

i want my program the read this eg: detect how many line are in the .txt file and to read it.

my code will make an object then first one
position it etc how do io do it.
l8er

----- dark coder -----
simonuk74
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 23rd Nov 2002 19:27
hmm, I think I know what your trying to do, but the way I did it was to use an array.
for example :
DIM infofile( info here about the object, position, so on )

then u can:
save array "drive:\filename",infofile(0)

then when you need it, load the array, and read the info from it to create the objects.

I hope that has helped

simon

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 24th Nov 2002 13:05
well i already thought of that but what i want is a file with a big list of the object infos, like a .x file with the list of all the faces+positions
all i wanna know is how to read the first line then second line of the .txt file, i know it is possible

l8er

----- dark coder -----
Kohai of UWDesign
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: France
Posted: 24th Nov 2002 18:25
This is a simple and old sequencial file-access snippet :



Now concerning a CSV (Comma Separated Vars ) format parser, try to look at the mistr$() & instr$() functions, posted in this thread :
http://www.darkbasicpro.com/apollo/view.php?t=1854&b=6

Basically, what you do is get the first comma in line. You then extract tha datas between start_of_line & comma_pos. Do this for each comma, and there you have a CSV parser ! ^^

[Kohai]
[url]www.underwaredesign.com[url] [url]kohaistyle.com[url]
pIII 733/256 Ram/Geforce 256

Login to post a reply

Server time is: 2024-04-18 02:20:31
Your offset time is: 2024-04-18 02:20:31