[Thread Prev] [Thread Next]
Extremely helpful, and just in time!
>>> wpetti@xxxx 10/22/01 06:12PM >>>
I have copied and pasted the information between the ***'s from the MWPro
Help menu. It is located under this topic: "Making a Text Box into a
Command Center."
***
Using the command onreadline, you can make a text box act like the Command
Center. This is useful for projects that you create for the Web since there
is no Command Center in the Web Player. This feature also makes classic word
and list projects better for presentations.
Onreadline's first input is the name of the text box where an instruction
will run when you press Enter. The second input is the instruction: a
procedure or Logo primitive that accepts a number, word or long word (a
sequence of characters including spaces) as input.
To try this out, create a text box named Text1. To make your text box act
like a Command Center, type (in the Command Center):
onreadline "text1 "run
The name tag of Text1 turns blue to show an onreadline instruction is
active. In this case, run runs its input as a Logo instruction. You can type
any Logo instruction in the text box. Try typing a command such as forward
50 in the text box now. It moves the turtle forward!
To turn off this feature, make the second input to onreadline empty.
onreadline "text1 "
To try onreadline with the name of a procedure, type reverse and printrev
into the Procedures Tab area:
to reverse :word
if empty? :word [output "]
output word last :word reverse butlast :word
end
to printrev :word
print reverse :word
end
Make sure that you have a text box called Text1 on the page, then type this
in the Command Center:
onreadline "text1 "printrev
Type a word into the text box and then press Enter.
Note: You can check the Project Tab Area for the names of the text boxes
with onreadline instructions.
***
And this info between the +++'s comes from the "onreadline" primitive
information:
+++
onreadline text-box-name instruction
Sets the designated text box to the instruction to be run when Enter is
pressed. The text box name tag changes to blue to show that an onreadline
instruction is active. The second input can be a procedure or a Logo
instruction that accepts a number, word or long word (a sequence of
characters including spaces) as input. To turn off the effect of onreadline,
make the second input an empty word as in:
onreadline text-box-name "
Onreadline is particularly useful for "faking" a Command Center in projects
for the Web.
+++
Now it's me (Wendy) again. Please note:
1) "Onreadline" is a MWPro primitive; it cannot be used with MW 2.0.
2) I've used an alternate method to turn a textbox into a command center
with MW 2.0:
If the textbox is named "text1" and there is only one line in the textbox or
you want to run the full contents of the textbox regardless of length:
run text1
(Note: Do not use a quotation mark.)
If there are two or more lines and you want to run the first line (for
instance):
run textitem 1 "text1
(Note: DO use a quotation mark before the name of the textbox. Textitem 1
refers to the first "logical line" of the textbox: all of the content until
the first Enter/Return.)
You can get interesting random effects by having the computer run a line
chosen at random from a list of commands in a textbox:
run textpick "text1
(It will pick a line at random and run the instruction(s) on that line.
I realize that that last idea does not address your particular situation but
you (or others) might like exploring the possibilities!
Wendy
> -----Original Message-----
> From: Gary McCallister [mailto:mccallis@xxxx]=20
> Sent: Monday, October 22, 2001 3:06 PM
> To: MWcybercourse@xxxxxxxxxxxxxxx=20
> Subject: Instructions in text boxes
>
>
> I have a program that runs variables. I would like to be
> able to type the command and variables in a text box and have
> them run (so I could run the whole thing in presentation mode).
> I remember reading about how this is done, but don't remember. I
> am using MicroWorlds Pro. Can someone explain this to me or give
> me a reference I could look at? Thanks!
>
Send messages to: MWcybercourse@xxxxxxxxxxxxxxx=20
To unsubscribe, e-mail: MWcybercourse-unsubscribe@xxxxxxxxxxxxxxx=20
MWcybercourse messages are archived at:
http://groups.yahoo.com/group/MWcybercourse=20
=20
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/=20
Previous by thread:
RE: Instructions in text boxes
Next by thread:
Is "dolist" three chili peppers hard?
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.
|