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 Professional Discussion / Reading from a text file

Author
Message
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 21st Jun 2003 13:38
I am trying to get db pro to read a dat file but I cant anyone know how to do that
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 21st Jun 2003 13:41
my post is slightly dif to fielddoc as I'm wanting to veryify user and password from one

pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 21st Jun 2003 15:13
Here is the code I have so far

Shadow
23
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 21st Jun 2003 19:54
surely you just need read string filenumber, variable$ ?
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 21st Jun 2003 20:31
Could you pheraps change my code accordingly or tell me how to do it as it's all new to me.

Shadow
23
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 21st Jun 2003 20:34
Unfortunately, I don't have DB on this computer, so I can't write you any code. On a side note, replace gosub exit_program with end
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 21st Jun 2003 20:46
Ok well when you get a moment could you have look please I would be greatful, thanks I'm using DBPRO patched on xp home.

the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 21st Jun 2003 21:49
What does login.dat look like when you open it with notepad?
I can't see what is wrong with the code.
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 21st Jun 2003 22:35
Its just says secret
secret

Duffer
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 21st Jun 2003 23:58
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 22nd Jun 2003 00:43
Really helpful post there Duffer wat woz ur text meant to be if any

the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 22nd Jun 2003 00:54
This code will load login.dat ask the user for a username and password and check if it matches the ones in the file.
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 22nd Jun 2003 00:59
but it also accepts anything else you put in the user/pass box I cant figure it out

the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 22nd Jun 2003 05:18
This will ask you for username/password until you get it right.

What exectly do you want to happen?
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 22nd Jun 2003 12:24
it asks for your user name and password but it also lets you put the wrong one and accepts it as being correct I want it to only acceptt the wright password.

BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Jun 2003 13:16
Is this thread just for one line statements?

Thanks in advance.
All the Best,
StevieVee
pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 22nd Jun 2003 13:18
Sotty misread your post and missed that you were actualy refering to some code you have posted here. the_winch thanks for that now is it possibel to do mulipel users on it. Maybe the code would be useful in code snippets. Also how do I make password stars

pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 22nd Jun 2003 13:19
Sorry not sotty we need a edit button on here

pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 22nd Jun 2003 14:11
I have tried to incorperate the code posted here which works great but the only problem I'm having is taking the old password script out it throws up errors any idea why.

Windows XP Home 2.53 GHz 512 Meg RAM Darkbasic Pro Patached
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 22nd Jun 2003 16:10
pinkvenom : look under your avatar and you will find that elusive edit button!

Gronda, Gronda
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 22nd Jun 2003 17:04
This code will work with multiple usernames/passwords. The login.dat file must be in this format.
username
pass
username
pass

If you want *'s to cover up the letters you will have to write your own input function. There are a few floating arround on the forums, perhaps in the code snippets board.
the_winch
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 22nd Jun 2003 17:05
This is it incorperated into the original code.
Bloodshot
23
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United Kingdom
Posted: 22nd Jun 2003 18:03 Edited at: 23rd Jun 2003 19:57
Here you go pinkvenom, I've looked at your code and fixed your file/password problems.

I've also tidied it up a bit by creating a function to handle all the text you want printed screen:


pinkvenom
23
Years of Service
User Offline
Joined: 14th Jun 2003
Location:
Posted: 22nd Jun 2003 18:04
Great thanx for that

Windows XP Home 2.53 GHz 512 Meg RAM Darkbasic Pro Patched

Login to post a reply

Server time is: 2026-07-18 09:23:56
Your offset time is: 2026-07-18 09:23:56