1. explain it to me

Could someone explain why I can't reassign a sequence like this

   rec = "123.45"

   rec = value(rec)
   rec = rec[2]            -- why can't I redefine rec this way if I don't
                                            want the 1st element (or any
others but the 2nd). It's awfully
                                            inconvinent  to have to go
through a temp var
                                            everytime.

And I would have thought that the following syntax would have also been
allowed

    rec = value(rec)[2]        -- this is valid in Theos Basic and seems
logical to me here also. It saves going through a temp var also.

...george

new topic     » topic index » view message » categorize

2. Re: explain it to me

A sequence can't hold an atom, which is what you are trying to do by
assigning rec[2] to rec.

If you make rec an object, then you can do what you propose.

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Subject: explain it to me


>
> Could someone explain why I can't reassign a sequence like this
>
>    rec = "123.45"
>
>    rec = value(rec)
>    rec = rec[2]            -- why can't I redefine rec this way if I don't
>                                             want the 1st element (or any
> others but the 2nd). It's awfully
>                                             inconvinent  to have to go
> through a temp var
>                                             everytime.
>
> And I would have thought that the following syntax would have also been
> allowed
>
>     rec = value(rec)[2]        -- this is valid in Theos Basic and seems
> logical to me here also. It saves going through a temp var also.
>
> ...george
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: explain it to me

Brian, doesn't value() return { x , y }, where x is the success variable and
y is the actual value?

----- Original Message -----
From: "Brian Broker" <bkb at cnw.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: explain it to me


>
> George,
>
> I can only assume that you are declaring the variable rec as an object
> in your example, otherise you would get an error at:
>
>   rec = value( rec )
>
> because now rec is holding the atom 123.45
>
> Now that rec is an atom, there is no such thing as rec[2].
>
> I'm not sure what you are trying to get so let me take a stab at it.
>
> Are you trying to get rec to hold an atom with a value of 2?
>
> If so, try:
>
> rec = value( rec[2] )
>
> -- Brian
>
>
> George Walters wrote:
> > Could someone explain why I can't reassign a sequence like this
> >
> >    rec = "123.45"
> >
> >    rec = value(rec)
> >    rec = rec[2]            -- why can't I redefine rec this way if I
don't
> >                                             want the 1st element (or any
> > others but the 2nd). It's awfully
> >                                             inconvinent  to have to go
> > through a temp var
> >                                             everytime.
> >
> > And I would have thought that the following syntax would have also been
> > allowed
> >
> >     rec = value(rec)[2]        -- this is valid in Theos Basic and seems
> > logical to me here also. It saves going through a temp var also.
> >
> > ...george
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: explain it to me

that makes sense....thanks

...george
----- Original Message -----
From: "C. K. Lester" <cklester at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: explain it to me


>
> A sequence can't hold an atom, which is what you are trying to do by
> assigning rec[2] to rec.
>
> If you make rec an object, then you can do what you propose.
>
> ----- Original Message -----
> From: "George Walters" <gwalters at sc.rr.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Wednesday, August 29, 2001 11:48 AM
> Subject: explain it to me
>
>
> > Could someone explain why I can't reassign a sequence like this
> >
> >    rec = "123.45"
> >
> >    rec = value(rec)
> >    rec = rec[2]            -- why can't I redefine rec this way if I
don't
> >                                             want the 1st element (or any
> > others but the 2nd). It's awfully
> >                                             inconvinent  to have to go
> > through a temp var
> >                                             everytime.
> >
> > And I would have thought that the following syntax would have also been
> > allowed
> >
> >     rec = value(rec)[2]        -- this is valid in Theos Basic and seems
> > logical to me here also. It saves going through a temp var also.
> >
> > ...george
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: explain it to me

> Could someone explain why I can't reassign a sequence like this
>
>    rec = "123.45"
>
>    rec = value(rec)
>    rec = rec[2]            -- why can't I redefine rec this way if I don't
>                                             want the 1st element (or any
> others but the 2nd). It's awfully
>                                             inconvinent  to have to go
> through a temp var
>                                             everytime.
CK Lester's solution is fine, but I prefer not to declare object variables
unless absolutely nessecary.
I do this..

rec=value(rec)
rec={rec[2]}

this also works....
rec=rec[2..2]
then there is no need for an object variable..

> And I would have thought that the following syntax would have also been
> allowed
>
>     rec = value(rec)[2]        -- this is valid in Theos Basic and seems
> logical to me here also. It saves going through a temp var also.
I'd vote for this one..
It has been asked for numerous times..

Chris

new topic     » goto parent     » topic index » view message » categorize

6. Re: explain it to me

Clever stuff, Chris! Thanks.

-ck

> I do this..
> 
> rec=value(rec)
> rec={rec[2]}
> 
> this also works....
> rec=rec[2..2]
> then there is no need for an object variable..

new topic     » goto parent     » topic index » view message » categorize

7. Re: explain it to me

now if I can just remember this stuff....

...george

----- Original Message ----- 
From: "C. K. Lester" <cklester at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: explain it to me


> 
> Clever stuff, Chris! Thanks.
> 
> -ck
> 
> > I do this..
> > 
> > rec=value(rec)
> > rec={rec[2]}
> > 
> > this also works....
> > rec=rec[2..2]
> > then there is no need for an object variable..
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: explain it to me

Praktiss makes perfekt, george. :)

> now if I can just remember this stuff....
> 
> ...george

new topic     » goto parent     » topic index » view message » categorize

9. Re: explain it to me

George,

I almost never remember all the good stuff people put here, so I made a
email folder "code examples" that I copy the best of the best to, for future
reference.  Only problem is when people write email subjects like "explain
it to me", instead of something which includes the *nature* of the desired
help,  which throws off my ability to easily browse through that folder by
subjects to retrieve something of interest ;)

Dan Moyer

----- Original Message -----
From: "George Walters" <gwalters at sc.rr.com>
To: "EUforum" <EUforum at topica.com>
Sent: Thursday, August 30, 2001 1:24 PM
Subject: Re: explain it to me


>
> now if I can just remember this stuff....
>
> ...george
>
> ----- Original Message -----
> From: "C. K. Lester" <cklester at yahoo.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Thursday, August 30, 2001 4:07 PM
> Subject: Re: explain it to me
>
>
> > Clever stuff, Chris! Thanks.
> >
> > -ck
> >
> > > I do this..
> > >
> > > rec=value(rec)
> > > rec={rec[2]}
> > >
> > > this also works....
> > > rec=rec[2..2]
> > > then there is no need for an object variable..
> >
> >
>
>

new topic     » goto parent     » topic index » view message » categorize

10. Re: explain it to me

Dan:
I find that the inconsistant subject lines are more commn than on topic
subject lines.  So what I've done is set up a 2nd E-mail account on
yahoo that no 1 knows about except me.  When I want to save something I
just fwd the message with an appropriate title to that E-mail acct. &
then download that into a similar special folder (like the 1 you
described).  Anything that wasn't sent by me is automatically trashed
by Yahoo.

Regards
Brian Keene

--- Dan Moyer <DANIELMOYER at prodigy.net> wrote:
> 
> George,
> 
> I almost never remember all the good stuff people put here, so I made
> a
> email folder "code examples" that I copy the best of the best to, for
> future
> reference.  Only problem is when people write email subjects like
> "explain
> it to me", instead of something which includes the *nature* of the
> desired
> help,  which throws off my ability to easily browse through that
> folder by
> subjects to retrieve something of interest ;)
> 
> Dan Moyer
> 
> ----- Original Message -----
> From: "George Walters" <gwalters at sc.rr.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Thursday, August 30, 2001 1:24 PM
> Subject: Re: explain it to me
> 
> 
> > now if I can just remember this stuff....
> >
> > ...george
> >
> > ----- Original Message -----
> > From: "C. K. Lester" <cklester at yahoo.com>
> > To: "EUforum" <EUforum at topica.com>
> > Sent: Thursday, August 30, 2001 4:07 PM
> > Subject: Re: explain it to me
> >
> >
> > > Clever stuff, Chris! Thanks.
> > >
> > > -ck
> > >
> > > > I do this..
> > > >
> > > > rec=value(rec)
> > > > rec={rec[2]}
> > > >
> > > > this also works....
> > > > rec=rec[2..2]
> > > > then there is no need for an object variable..
> > >
> > >
> 
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu