Replacing a number with an asterisk.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 18
- Joined: Wed Apr 04, 2007 7:48 pm
- Location: Sarasota High School, Sarasota, FL
- Contact:
Replacing a number with an asterisk.
I am authoring a program for my students and want to have them stop, show me their work, and I type in a code (0051) before they can proceed on.
Here is what I have:
on mouseUp
ask "Now that you have your stamp, have your teacher type in the code to continue."
put it into rightcode
if rightcode is "0051" then go next
if rightcode is not "0051" then answer "No - you cannot proceed on until you type in the correct code!"
end mouseUp
The script is easy but I don't want the code appearing on screen - instead I want to replace each number with an asterisk so the students cannot see what I am typing.
I've searched the forum and cannot find anything that will help me do this. Anyone have any suggestions?
Thanks,
Doug Gilliland
Here is what I have:
on mouseUp
ask "Now that you have your stamp, have your teacher type in the code to continue."
put it into rightcode
if rightcode is "0051" then go next
if rightcode is not "0051" then answer "No - you cannot proceed on until you type in the correct code!"
end mouseUp
The script is easy but I don't want the code appearing on screen - instead I want to replace each number with an asterisk so the students cannot see what I am typing.
I've searched the forum and cannot find anything that will help me do this. Anyone have any suggestions?
Thanks,
Doug Gilliland
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
The simplest way is:
More complex is using the keydown message because you need to make it all yourself.
Code: Select all
ask password "enter the secret number"
if it <> "" and it = "0051" then
--do your thing here
end if
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Hi gillilandd,
try this:
Best
Klaus
try this:
Code: Select all
on mouseUp
ask password CLEAR "Now that you have your stamp, have your teacher type in the code to continue."
## Needs to be CLEAR or you cannot check it afterwards, see the docs!
put it into rightcode
if rightcode = "0051" then
go next
else
answer "No - you cannot proceed on until you type in the correct code!"
end if
end mouseUp
Best
Klaus
-
- Posts: 18
- Joined: Wed Apr 04, 2007 7:48 pm
- Location: Sarasota High School, Sarasota, FL
- Contact:
Hi,
I created a little stack with a password field, which you can copy into your own project. Go to the Economy-x-Talk homepage (see below), click on the Developer link on the left and find the Password Fields stack the bottom of that page.
Best,
Mark
I created a little stack with a password field, which you can copy into your own project. Go to the Economy-x-Talk homepage (see below), click on the Developer link on the left and find the Password Fields stack the bottom of that page.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode