Hi

I've got an answer for you.

>> num: ask "Car number please?"
Car number please?3
== "3"
>> ChosenCar: get to-word join "car" num
>> chosencar/model
== "Riviera"
>>

Patrick

PS: I learned this method from Ingo Hohmann from the rebol-list a few month
ago.


----- Original Message -----
From: "Martin Middleton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 19, 2002 8:52 PM
Subject: [REBOL] An object by another name


> Let's say I have the following:
>
> car: make object! [
>      make: "Ford"
>      model: "Custom 500"
>      color: white
> ]
>
> car1: make car [
>        model: "Escort"
>        color: red
> ]
>
> car2: make car [
>      model: "Taurus"
>      color: blue
> ]
>
> car3: make car [
>      make: "Buick"
>      model: "Riviera"
>      color: silver
> ]
>
> And assume that my REBOL program asks the user the to enter a number
> between 1 and 3 and that I save the response in something called
car-choice.
>
> How can I "combine" (probably a bad choice of terminology) the value "car"
> and the user's response so that I end up with a value I can use to refer
to
> the proper object. In other words, if the user enters "2", I want to be
> able to do something like:
>
>      car-chosen: car2 [I know I can't just "join" the two values to create
> a pointer to car2]
>
> so that later in the script I can refer to the variables within car-chosen
as
>
>      print car-chosen/model
>
> which should display "Taurus".
>
>
> - martin
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to