Simple Login System - Tutorial not working as described
Posted: Mon Jan 20, 2014 3:26 pm
Hi,
I wonder if someone can shed some light on the above tutorial, which I was trying out, but it does not behave as described. I have created the main stack and two cards with the code as described, but it does not seem to work as seen in the tutorial example. The code that does not seem to execute is:
local sUsername, sPassword
on openCard
put "johnsmith" into sUsername
put "pa55word" into sPassword
end openCard
on loginCheck
if field "username" is sUsername and field "password" is sPassword then
answer "Login Successful"
go to card "accessed"
else
answer "Details Incorrect. Please try again!"
end if
end loginCheck
but if I replace the code with:
local sUsername, sPassword
on openCard
put "johnsmith" into sUsername
put "pa55word" into sPassword
end openCard
on mousedown
if field "username" is sUsername and field "password" is sPassword then
answer "Login Successful"
go to card "accessed"
else
answer "Details Incorrect. Please try again!"
end if
end mousedown
Is this correct or is there something that I am missing or mis-understanding.
Code base : livecode - community
Version : 6.5.1
Platform : windows 7
Thanks,
Milan
I wonder if someone can shed some light on the above tutorial, which I was trying out, but it does not behave as described. I have created the main stack and two cards with the code as described, but it does not seem to work as seen in the tutorial example. The code that does not seem to execute is:
local sUsername, sPassword
on openCard
put "johnsmith" into sUsername
put "pa55word" into sPassword
end openCard
on loginCheck
if field "username" is sUsername and field "password" is sPassword then
answer "Login Successful"
go to card "accessed"
else
answer "Details Incorrect. Please try again!"
end if
end loginCheck
but if I replace the code with:
local sUsername, sPassword
on openCard
put "johnsmith" into sUsername
put "pa55word" into sPassword
end openCard
on mousedown
if field "username" is sUsername and field "password" is sPassword then
answer "Login Successful"
go to card "accessed"
else
answer "Details Incorrect. Please try again!"
end if
end mousedown
Is this correct or is there something that I am missing or mis-understanding.
Code base : livecode - community
Version : 6.5.1
Platform : windows 7
Thanks,
Milan