[Thread Prev] [Thread Next]
Oh, I see.
Put the username AND the password in the same text box. Each text box
will contain two lines. The first line is the username, the second
line is the password.
Then,
Put ALL your login textboxes on a different (not visible) page. Name
that page "logboxes" and come back to your working page. You don't see
the text boxes, but that's ok.
Then
to test
compare currentuser get "page1 "texts
end
to compare :user :listoftextboxnames
if empty? :listoftextboxnames [dowhatever stop]
if :user = textitem 1 first :listoftextboxnames
[checkpassword first :listoftextboxnames stop]
compare :user bf :listoftextboxnames
end
to checkpassword :textboxname
if currentpass = textitem 2 :textboxname [youreok]
end
to currentuser
question [username please]
op answer
end
to currentpass
question [pass please]
op answer
end
Note: careful when copying text from email to MW. Sometimes stange
delimiters in the text makes MW "not understand" what you typed.
Le 08-03-31 à 21:13, Henry Wilson a écrit :
the textbox, currentuser, would be set to the user the person typed
in in the question. so currentuser = log1 means the user the person
typed in when clicking on login equals the one he or she set up.
thanks
On Mar 31, 2008, at 8:50 PM, LCSI wrote:
Hi,
I would do something like:
to test
if currentpass = run word "log (last currentuser) + 1 [thendothis]
end
For example:
if currentuser equall log3, the procedure test will do the
following:
if currentpass = run log (last log3) + 1
or
if currentpass = run word "log 3 + 1
or
if currentpass = run word "log 4
or
if currentpass = run log4
or
if currentpass = whatever reports log4
AT
Le 08-03-31 à 20:34, Henry Wilson a écrit :
Sort of. What I mean is that I dont want to do a new line for each
one,
if currentuser = log1 [thendothis]
when I do that, I have to make a new line for log1, when log1 is
created, and log2, and log3, and log4, and so on. If someone
creates a user, with the username as log1, and the password as
log2, I would do this.
if currentuser = log1 [if currentpass = log2 [thendothis]]
if currentuser = log3 [if currentpass = log4 [thendothis]]
if currentuser = log5 [if currentpass = log6 [thendothis]]
and so on.
On Mar 31, 2008, at 8:23 PM, LCSI wrote:
Hi,
Not sure I understand, but if you mean:
How can I report the contents of a text box based on a variable
instead of the actual name, in order to avoid having ONE full IF
statement for each user?
Then the answer (or part of the answer) would be:
if currentuser = run word "log :n [thendothis]
word "log :n
will report something like
log1
running that will report the contents of the text box named
log1
Is that it?
Le 08-03-31 à 20:05, Henry Wilson a écrit :
to doall :n
make "n nusern
newtext word "log :n
se -200 (200 -(:n * 25))
[100 25]
question [Set username]
run se (word "setlog :n) (word "" answer)
setnusern nusern + 1
make "n nusern
newtext word "log :n
se -200 (200 -(:n * 25))
[100 25]
question [Set password]
run se (word "setlog :n) (word "" answer)
end
this program works for creating two boxes, one with username,
one with password. I was stuck when trying to get it so that
they could login. I could make a question for user and pass, and
have a text box, currentpass , set to the answer of the password
question, and currentuser for the user question. If I did this,
if currentuser = log1 [announce [logged on]]
stop
but this would not work in less I manually added if currentuser
= log1, if currentuser = log2, etc.
Is there any way to do this so when someone creates a new user,
I need to do nothing for it to work?
thanks
On Mar 31, 2008, at 7:06 PM, LCSI wrote:
Hi!
Ho! I see the problem. Your text box is called LOG1 (or
LOG2...). So, the dynamic primitives (based on the text box
name) are:
SETLOG1
and
LOG1
So when you say
SETLOG
this corresponds to nothing.
You need to run something like SETLOG1
There are two solutions:
run se (word "settext 1) (word "" "bar)
That works, but it's awful Replace RUN by SHOW to visualize
what's going on.
Or, simpler:
tto word "setlog :n
ct pr answer
There you go! Yo seem to know what you're doing! Congrats!
AT
Le 08-03-31 à 18:27, Henry Wilson a écrit :
Here is the code, given there is a button which does newuser 1
and a textbox called nusern
When I tried it, I had difficulty in getting it to set the
content of the text box. With the code below, when I tried it,
it said "I DONT KNOW HOW TO SETLOG"
to newuser :n
make "n nusern
newtext word "log :n
se -200 (200 -(:n * 25))
[100 25]
question [Set username]
setlog :n answer
setnusern nusern + 1
end
On Mar 31, 2008, at 1:40 PM, Alain Tougas wrote:
Hum!
Sorry, not enough info to help you.
Can you write, in plain English (pseudo code), what your
button has to do?
AT
-----Original Message-----
From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx]On Behalf
Of Henry
Wilson
Sent: Monday, March 31, 2008 1:21 PM
To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [MWForum] MIA, Ask an Expert: interactive text box
Hi, sorry to ask so many questions. Last one.
I am making a feature in my log in program so that you can
create a
new user by clicking a button.
I cant think of the right way to do it
if you have any ideas please help.
Thanks
henry
On Mar 31, 2008, at 12:49 PM, Alain Tougas wrote:
Hi!
Sure!
Check onreadline in the Help, in the section about Text
boxes, or in
the
vocabulary.
Basically, you run (only once) an instruction such as:
onreadline "text1 "run
and the text box named text1 will "run" each line when you
type
something in
it and press Enter.
99% of people will do exactly that, but you may use any
instruction:
onreadline "text1 "fd (be sure you type only numbers in that
text box)
onreadline "text1 "go (that, being a procedure name)
AT
-----Original Message-----
From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx]On Behalf
Of
askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sent: Monday, March 31, 2008 9:44 AM
To: askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: [MWForum] MIA, Ask an Expert: interactive text box
This is an automatic message sent from the web form at:
http://www.openworldlearning.org/mia/howdoi.htm
from: henryhwilson@xxxxxxxxx>
date: Mon Mar 31 07:44:19 2008
platform: Mac OS10
version: MicroWorlds Ex
I had heard that you could make a text box the command
center, so
typing
things in the text box will make it run programs just like
the command
center. How do I do this?
Previous by thread:
Re: MIA, Ask an Expert: interactive text box
Next by thread:
Re: MIA, Ask an Expert: interactive text box
To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.
|