passing quotes parameters to a 'send' message...

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

passing quotes parameters to a 'send' message...

Chipp Walters
Hmmm
I know this isn't supposed to be this hard...

create a button named 'fred'

on mouseUp
   put the long name of me into tName
   send ("putInMsg" && tName) to me
end mouseUp

on putInMsg p
   put p
end putInMsg

I get nadda. I know the quotes are screwing it up someway. Do I need to
encode with some sort of quote function?

I've tried

send ("putInMsg" && quote & tName & quote) to me

but this adds 2 quotes, 1 before and 1 after. I seem to remember being
able to do it the first way before...

-Chipp

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: passing quotes parameters to a 'send' message...

Jeanne A. E. DeVoto
At 5:45 PM -0500 7/12/2005, Chipp Walters wrote:

>Hmmm
>I know this isn't supposed to be this hard...
>
>create a button named 'fred'
>
>on mouseUp
>   put the long name of me into tName
>   send ("putInMsg" && tName) to me
>end mouseUp
>
>on putInMsg p
>   put p
>end putInMsg

Try

   send "putInMsg tName" to me
--
jeanne a. e. devoto ~ [hidden email]
http://www.jaedworks.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: passing quotes parameters to a 'send' message...

Jim Bufalini
In reply to this post by Chipp Walters
This worked for me.
All in button Fred:

on mouseUp
  put quote & the long name of me & quote into tName
  send "putInMsg" &&  tName to me
end mouseUp

on putInMsg tName
  answer "I got the" && tName
end putInMsg

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]]On Behalf Of Chipp
Walters
Sent: Tuesday, July 12, 2005 12:46 PM
To: Use-Revolution
Subject: passing quotes parameters to a 'send' message...


Hmmm
I know this isn't supposed to be this hard...

create a button named 'fred'

on mouseUp
   put the long name of me into tName
   send ("putInMsg" && tName) to me
end mouseUp

on putInMsg p
   put p
end putInMsg

I get nadda. I know the quotes are screwing it up someway. Do I need to
encode with some sort of quote function?

I've tried

send ("putInMsg" && quote & tName & quote) to me

but this adds 2 quotes, 1 before and 1 after. I seem to remember being
able to do it the first way before...

-Chipp

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: passing quotes parameters to a 'send' message...

Alex Tweedly
In reply to this post by Jeanne A. E. DeVoto
Jeanne A. E. DeVoto wrote:

>
> Try
>
>   send "putInMsg tName" to me

OK, it works. But *why* ?  In any other context,  the content of a
quoted string is not evaluated -
put "putInmsg tName" after msg
puts that literal string into the message box.

Even stranger, you can also do
  send ("putInMsg extratext" && tName) to me
and in that case it comes through with the parameter set to
   extratext button "Button" of card id 1002 of stack "Untitled 1"

but removing the 'extratext' makes it not work.

I tried checking the docs (always an optimist), and it gives the example
    send "goThere" && field "Where To" to stack "Destination" in 30
I tried that (changing the destination to be "me") and that fails with
the same problem Chipp reported.

--
Alex Tweedly       http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.12/46 - Release Date: 11/07/2005

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: passing quotes parameters to a 'send' message...

Jim Bufalini
In reply to this post by Jim Bufalini
You know what's funny on this that I forgot to mention, if you leave out the
second *quote* as in

 put quote & the long name of me into tName

it still works and you don't get an extra quote at the end. But leave out
both quotes and you get nothing??? Must have something to do with there
being quotes in the long name of...

-Jim

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]]On Behalf Of Jim
Bufalini
Sent: Tuesday, July 12, 2005 1:19 PM
To: [hidden email]; How to use Revolution
Subject: RE: passing quotes parameters to a 'send' message...


This worked for me.
All in button Fred:

on mouseUp
  put quote & the long name of me & quote into tName
  send "putInMsg" &&  tName to me
end mouseUp

on putInMsg tName
  answer "I got the" && tName
end putInMsg



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: passing quotes parameters to a 'send' message...

Dar Scott
In reply to this post by Alex Tweedly

On Jul 12, 2005, at 5:24 PM, Alex Tweedly wrote:

>> Try
>>
>>   send "putInMsg tName" to me
>
> OK, it works. But *why* ?  In any other context,  the content of a
> quoted string is not evaluated -

Think of it as a 'do' that also specifies the message path location and
maybe changes the defaultStack.

The statement is executed right up until the actual invocation (the
parameters are evaluated by this time), and then there's an optional
wait until some time, and then it is dropped into the message path
pinball machine.

Dar

--
**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     Programming and software
**********************************************

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: passing quotes parameters to a 'send' message...

Chipp Walters
In reply to this post by Jeanne A. E. DeVoto
Jeanne,

Thanks, that is just too weird. Doesn't seem like it *should* work, but
it does.

best,
Chipp

Jeanne A. E. DeVoto wrote:

> Try
>
>   send "putInMsg tName" to me
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: passing quotes parameters to a 'send' message...

Dar Scott

On Jul 13, 2005, at 1:03 AM, Chipp Walters wrote:

> Thanks, that is just too weird. Doesn't seem like it *should* work,
> but it does.

If you like weird, try this:

on mouseUp
   send "beep -- herald something" to me
   send "set the backcolor of me to red" to button "B"
end mouseUp

This works.  Even if you add 'in <fakeDelay>', you can see the
"handler" is named "set" in the pendingMessages().

Now just when that and invoking a custom command with variable
parameters in a send start to make sense, try this:

on mouseUp
   put blue into newColor
   send "beep -- anounce something" to me
   send "set the backcolor of me to newColor" to button "B"
end mouseUp

That fails with "can't find hander ... set".

Now if you try 'in <fakeDelay>', you can still see the message in
pendingMessages(), but because it is 'in <fakeDelay>', then there is no
error message if the handler is not found (the color is not changed).

However, this works just fine:

on mouseUp
   put blue into newColor
   do "set the backcolor of me to newColor"
end mouseUp

Except it is now the button you clicked not "B" that is changed.  And
'do' will work just fine with a custom command with variable
parameters.

Try this:

on mouseUp
   put blue into newColor
   send "put newColor after message" to button "B"
end mouseUp

Y' get "newColor" added to the message box.

So what is the one case that is different?  It is the lack of the
ability to use variable parameters in non-custom commands.  IMHO, that
is the weird part.  But maybe that is a good thing.

Try this:

on mouseUp
   send "dosomething v()" to me in 2 seconds
end mouseUp

function v
   beep
   return 5
end v

on doSomething x
   put x after message
end doSomething

I hear the beep and then two seconds later the 5 is added to the
message box.

on mouseUp
   send "put the backcolor of me after message" to button "B"
end mouseUp

That displays the color of button "B".  If that weird part I mentioned
above is "fixed", then that would probably change.  Maybe we don't want
it to.  I'm OK with the change.

Dar

--
**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     Programming and software
**********************************************

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution