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 / Read file line by line

Author
Message
ATnT
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 27th May 2004 18:58
How can i read a file line by line?

Also, how would i be able to split a line read from the file using a coma as a delimeter?

The file layout is like this;

#settings
blah
blah2
blah3

#main
bleh,bleh,bleh
123a,123b,123c
foo,foo,foo,foo

#.......


Any ideas?
Thanks!
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 27th May 2004 19:26
I think read string$ reads it line by line. As to the comma delimiting, you'll have to set up a function to do it yourself. Get the length of the string, then step through it using a for loop, appending every character to a string using mid$ until you get to a comma, then do it until you reach the end of the string.

Its not a bug, its a feature!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th May 2004 19:45 Edited at: 27th May 2004 19:47
we have a plugin that can help
see below

edit: also dbp command load array will load each line of a file into an array element, see our plugin string functions if you need split and "real" mid functions and the like


* DBP_NETLIB_v1.1 - VB.NET PLUGIN FOR DBP * Click Logo
ATnT
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 27th May 2004 20:12 Edited at: 27th May 2004 20:13
Thanks.

BTW, i know what yu mean by "real" functions, i miss VB programming lol
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th May 2004 21:01 Edited at: 27th May 2004 21:01
dbp mid = "fake"
our plugin str_Mid() = "real"

real being vb/vb.net mid function

I suggest you go to our plugin page and click the link for the documentation - you'll see all the glorious functions explained


* DBP_NETLIB_v1.1 - VB.NET PLUGIN FOR DBP * Click Logo
ATnT
20
Years of Service
User Offline
Joined: 20th May 2004
Location:
Posted: 28th May 2004 12:48
I know what you meant

I may make my own plugin... there are some functions i would be able to code much more easily in another language than DBP

Login to post a reply

Server time is: 2024-11-26 18:36:50
Your offset time is: 2024-11-26 18:36:50