Login from?

BlitzPlus Forums/BlitzPlus Programming/Login from?

arget brisingr(Posted 2007) [#1]
This is what I have so far:


;my login from
;variables
usernm = 141
passwd = 89511

Goto anew

.bnew
newuser = Input$("What is your perferd user (must be a number)? ")
newpass = Input$("Password (must be a number)? ")
Delay 250
Print "Thank You!"
Print " "
Delay 500
Goto begin

.aNew
k = Input$("Do you have an account (press 1 for yes, 2 for no)? ")

If k = 1 Then
Delay 250
Print "Thank You!"
Print " "
Delay 150
Goto begin

Else If k = 2 Then
Print " "
Delay 500
Delay 150

Goto bnew

Else
Print "what?"
Delay 100
Goto aNew

EndIf 

.begin
user = Input$("User: ")
pass = Input$("Pass: ")

If user = usernm And pass = 89511 Then
Print "Congrats!"
Delay 3500
End 

Else
Print "sorry!"
Print " "
Delay 1000
Goto begin

EndIf




I want the user and pass to come from a file called user.txt
and I also I want if the person presses 2 I want it to take them to a form were they can make an account and then that account gets saved to user.txt.


Dabz(Posted 2007) [#2]
Bloody hell, I'm not being cheeky, but I've never seen code like that since the 80's!!!

Its a bit of a slug to read, you should make it more readable for our sake, and simplify the execution, for your users sake... ! ;)



Dabz


arget brisingr(Posted 2007) [#3]
Sorry, I am not that good yet :(


Dabz(Posted 2007) [#4]

Sorry, I am not that good yet :(



No sweat! ;) Just try not to rely on the Goto command as often, as it makes code harder to read, and harder to understand how the program is flowing.

If you browse through the samples, and other peoples work, you'll sharp learn, so keep it up! :D

Dabz


H&K(Posted 2007) [#5]
Hummm, I think that whatever book/course you are following is outdated. Its not really a question of not being good enough yet.

Its sort of like using 16th Century English, then saying "Sorry Ive only been learning for a year", youve basicly been learning the wrong English.

Dont get me wrong, you will learn to program following such a course, but you might as well miss the 80's out.


CS_TBL(Posted 2007) [#6]
Apart from the gotos, this is all posted in this B+ section, I'd say: use the GUI! A GUI like Windows was made to make exactly these kind of interactions easier to make. Typically all the interaction between human and computers takes up 90% of the whole code time, having a standard GUI instead is a revelation.