Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LOGO-L> using variables to create a procedure name

1 view
Skip to first unread message

jlwo...@my-deja.com

unread,
Jul 2, 1999, 3:00:00 AM7/2/99
to log...@gsn.org

This may be a simple idea, but I would appreciate some guidance.

This happens to be creating football formations for drawing of plays.

I am making a play formation by combining a formation set-up and the side of
the strength.

I am asking the operator to select a formation such as

1 - power
2 - slot

and then MAKE "CH_FORM READCHAR

and

L - left
R - right

and then MAKE "CH_SIDE READCHAR

I now want to form the actual formation: such as 1 & L will now create the
name of the procedure POWER_LEFT and 2 & R will create SLOT_RIGHT.

I already have the procedures POWER_LEFT and SLOT_RIGHT. My question is how
to let the operator create the procedure name from their choices.

I would hope to be able to use string addition ( a BASIC term) instead of a
multitude of IF AND statements. Also how does this become a procedure name
instead of a variable?

Any help is greatly appreciated. THANK YOU !


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---------------------------------------------------------------
Please post messages to the Logo forum to log...@gsn.org. Mail
questions about the list administration to log...@gsn.org. To
unsubscribe send unsubscribe logo-l to majo...@gsn.org.

Paul C Dench

unread,
Jul 5, 1999, 3:00:00 AM7/5/99
to jlwo...@my-deja.com, log...@gsn.org
Hello

This doesn't sound like Australian Rules Football or Soccer so I may have
misunderstood but here goes:

=============
to action
ifelse equalp :CH_FORM 1 [make "PLAY "POWER_][make "PLAY "SLOT_]
ifelse equalp :CH_SIDE "L~
[make "PLAY word :PLAY "LEFT][make "PLAY word :PLAY "RIGHT]
run :PLAY
end
==============

the procedure action will convert your two decisions into one of four words
- POWER_RIGHT, POWER_LEFT, SLOT_RIGHT or SLOT_LEFT and then 'run :PLAY'
will call the procedures you have already written.

Regards


At 10:43 PM 7/2/99 -0700, jlwo...@my-deja.com wrote:
>
>This may be a simple idea, but I would appreciate some guidance.
>
>This happens to be creating football formations for drawing of plays.
>
>I am making a play formation by combining a formation set-up and the side of
>the strength.
>
>I am asking the operator to select a formation such as
>
>1 - power
>2 - slot
>
>and then MAKE "CH_FORM READCHAR
>
>and
>
>L - left
>R - right
>
>and then MAKE "CH_SIDE READCHAR
>
>I now want to form the actual formation: such as 1 & L will now create the
>name of the procedure POWER_LEFT and 2 & R will create SLOT_RIGHT.
>
>I already have the procedures POWER_LEFT and SLOT_RIGHT. My question is how
>to let the operator create the procedure name from their choices.
>
>I would hope to be able to use string addition ( a BASIC term) instead of a
>multitude of IF AND statements. Also how does this become a procedure name
>instead of a variable?
>
>Any help is greatly appreciated. THANK YOU !

Paul C Dench

Logo for Teachers and Parents
<http://www.cowan.edu.au/pa/ecawa/sig/logo/paul_dench/turtle/>

Terrapin

unread,
Jul 5, 1999, 3:00:00 AM7/5/99
to jlwo...@my-deja.com, log...@gsn.org
In PC Logo, you can use the command DEFINE to create a new procedure. You
can use the command TEXT to output the definition of a currently defined
procedure (in the format that DEFINE needs). One way to change the name
of a procedure is to DEFINE a new procedure name with the TEXT of a
currently
existing procedure. Use PROCEDURE? to be sure the new procedure is defined
and then you can erase the old procedure if you want to.

Bill

****************************************************************
Harvard Associates & makers of PC Logo and LogoPLUS
Terrapin Software Internet: in...@terrapinlogo.com
10 Holworthy Street phone: (617) 492-0660
Cambridge, MA 02138 USA fax: (617) 492-4610
World Wide Web: www.terrapinlogo.com
****************************************************************

>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

gary mccallister

unread,
Jul 5, 1999, 3:00:00 AM7/5/99
to Paul C Dench
Football is soccer. The American thing is something else. Since the
entire world pretty much agrees with this definition it makes any protest
by Americans pretty lame. The orginal message was about this "something
else".

On Mon, 5 Jul 1999, Paul C Dench wrote:

> Hello
>
> This doesn't sound like Australian Rules Football or Soccer so I may have
> misunderstood but here goes:
>
> =============
> to action
> ifelse equalp :CH_FORM 1 [make "PLAY "POWER_][make "PLAY "SLOT_]
> ifelse equalp :CH_SIDE "L~
> [make "PLAY word :PLAY "LEFT][make "PLAY word :PLAY "RIGHT]
> run :PLAY
> end
> ==============
>
> the procedure action will convert your two decisions into one of four words
> - POWER_RIGHT, POWER_LEFT, SLOT_RIGHT or SLOT_LEFT and then 'run :PLAY'
> will call the procedures you have already written.
>
> Regards
>
>
> At 10:43 PM 7/2/99 -0700, jlwo...@my-deja.com wrote:
> >

> >This may be a simple idea, but I would appreciate some guidance.
> >
> >This happens to be creating football formations for drawing of plays.
> >
> >I am making a play formation by combining a formation set-up and the side of
> >the strength.
> >
> >I am asking the operator to select a formation such as
> >
> >1 - power
> >2 - slot
> >
> >and then MAKE "CH_FORM READCHAR
> >
> >and
> >
> >L - left
> >R - right
> >
> >and then MAKE "CH_SIDE READCHAR
> >
> >I now want to form the actual formation: such as 1 & L will now create the
> >name of the procedure POWER_LEFT and 2 & R will create SLOT_RIGHT.
> >
> >I already have the procedures POWER_LEFT and SLOT_RIGHT. My question is how
> >to let the operator create the procedure name from their choices.
> >
> >I would hope to be able to use string addition ( a BASIC term) instead of a
> >multitude of IF AND statements. Also how does this become a procedure name
> >instead of a variable?
> >
> >Any help is greatly appreciated. THANK YOU !
>

> Paul C Dench
>
> Logo for Teachers and Parents
> <http://www.cowan.edu.au/pa/ecawa/sig/logo/paul_dench/turtle/>

0 new messages