value function fails for multi-line input

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

value function fails for multi-line input

Dick Kriesel
Each of the following causes the 2.6 engine on Mac OS X 10.4.1 to report
"error executing expression:"

    put value( "a" & cr & "b")

    put "a" & cr & "b" into c; put value(c)

    set the lineDelimiter to "|"; put value("a|b")

In contrast, the following succeeds:

    set the lineDelimiter to "_"; put value("a_b")

If you¹d like to add votes, please see BugZilla 2904.

-- Dick
_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: value function fails for multi-line input

Pat Trendler
Dick,

"a" is a string not the variable a
either of the following lines will work:

 put value (a) & cr & (b)
 put value (a) & cr & value (b) into c; put value(c)

But, really, you can just say:

put a & cr & b into c
put c

Pat
[hidden email]

----- Original Message -----
From: "Dick Kriesel" <[hidden email]>
To: "How to use Revolution" <[hidden email]>
Sent: Tuesday, June 14, 2005 6:35 PM
Subject: value function fails for multi-line input


Each of the following causes the 2.6 engine on Mac OS X 10.4.1 to report
"error executing expression:"

    put value( "a" & cr & "b")

    put "a" & cr & "b" into c; put value(c)

    set the lineDelimiter to "|"; put value("a|b")

In contrast, the following succeeds:

    set the lineDelimiter to "_"; put value("a_b")

If you?d like to add votes, please see BugZilla 2904.

-- Dick
_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Associating a file with an Image Object

David Burgun
Hi All,

I want to be able to choose and image file and have that image appear
in an "image" object. I can't seem to find out how to do this! I have
the following script on a "Choose" button:

on mouseUp
answer file "Please select an Image"
put it into field "FilePathName"

--
--  Now I want to set the image file selected by the user to be
displayed in "Image1", the following doesn't work!
--
set the text of image "Image1" to it
end mouseUp

Could anyone tell me how to acheive this?

Thanks a lot
Dave
_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Associating a file with an Image Object

Brian Yennie
David,

What you're looking for is the "fileName" property:

answer file "Please select an image"
if (there is a file it) then
     set the fileName of image "Image1" to it
end if

- Brian

> Hi All,
>
> I want to be able to choose and image file and have that image appear
> in an "image" object. I can't seem to find out how to do this! I have
> the following script on a "Choose" button:
>
> on mouseUp
> answer file "Please select an Image"
> put it into field "FilePathName"
>
> --
> --  Now I want to set the image file selected by the user to be
> displayed in "Image1", the following doesn't work!
> --
> set the text of image "Image1" to it
> end mouseUp
>
> Could anyone tell me how to acheive this?
>
> Thanks a lot
> Dave
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

RE: Associating a file with an Image Object

MisterX
In reply to this post by David Burgun
there's two ways of doing this David

After you've chosen the image file

answer file "choose and image"

put it into thisimagepath
put the long id of image x into thisimage
set the path of thisimage to thisimagepath

(image by reference)

or

put "file:" before thisimage
set the imagedata of thisimage to url thisimage

(Image by data!) - more dangerous though... if the image is corrupted...
anything can happen...

cheers
Xavier
http://monsieurx.com/taoo

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> David Burgun
> Sent: Tuesday, June 14, 2005 13:38
> To: How to use Revolution
> Subject: Associating a file with an Image Object
>
> Hi All,
>
> I want to be able to choose and image file and have that
> image appear in an "image" object. I can't seem to find out
> how to do this! I have the following script on a "Choose" button:
>
> on mouseUp
> answer file "Please select an Image"
> put it into field "FilePathName"
>
> --
> --  Now I want to set the image file selected by the user to
> be displayed in "Image1", the following doesn't work!
> --
> set the text of image "Image1" to it
> end mouseUp
>
> Could anyone tell me how to acheive this?
>
> Thanks a lot
> Dave
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Associating a file with an Image Object

Eric Chatonet
In reply to this post by David Burgun
Hi David,

1. The answer file command put the path of the selected file into the  
it variable, not its contents :-)
Something like "/Applications/Revolution 2.6/components/help/
dictionary/answer_file_command.xml"
2. There are many ways to display an image : by setting its filename  
property (then the image is not in the stack but the stack refers to  
a separate  file), by setting its imageData property to the file's  
binary contents, etc.
3. You might be interested by my #005 How to drag and drop images and  
different ways to STORE images.
Have a look at my website and download Tutorials Picker which allows  
to access all tutorials in real time.

Best regards from Paris,

Eric Chatonet.

Le 14 juin 05 à 13:38, David Burgun a écrit :

> on mouseUp
> answer file "Please select an Image"
> put it into field "FilePathName"
>
> --
> --  Now I want to set the image file selected by the user to be  
> displayed in "Image1", the following doesn't work!
> --
> set the text of image "Image1" to it
> end mouseUp

----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Plugins, tutorials and more on our website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        [hidden email]/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Associating a file with an Image Object

Klaus major-k
In reply to this post by David Burgun
Hi David,

> Hi All,
>
> I want to be able to choose and image file and have that image  
> appear in an "image" object. I can't seem to find out how to do  
> this! I have the following script on a "Choose" button:
>
> on mouseUp
> answer file "Please select an Image"
> put it into field "FilePathName"
>
> --
> --  Now I want to set the image file selected by the user to be  
> displayed in "Image1", the following doesn't work!
> --
> set the text of image "Image1" to it
> end mouseUp
>
> Could anyone tell me how to acheive this?

yes, you have two options:
1. reference the image, just set the filename...
2. copy that image into your stack

on mouseUp
    answer file "Please select an Image"
    put it into field "FilePathName"
    ##1.
    set the filename of img "Image1" to it

    ##OR
    ##2.
    ## put url("binfile:" & it) into img "Image1"
end mouseUp

Hope that helps.

> Thanks a lot
> Dave

Regards

Klaus Major
[hidden email]
http://www.major-k.de

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Associating a file with an Image Object

David Burgun
Hi,

Thanks for that! It now works for JPEG files but not TIFF for some
reason, do you have to do something special to attach a TIFF file to
an Image Object?

And thanks Eric for the pointer to your web site, I will take a look at it now.

All the Best
Dave


>Hi David,
>
>>Hi All,
>>
>>I want to be able to choose and image file and have that image
>>appear in an "image" object. I can't seem to find out how to do
>>this! I have the following script on a "Choose" button:
>>
>>on mouseUp
>>answer file "Please select an Image"
>>put it into field "FilePathName"
>>
>>--
>>--  Now I want to set the image file selected by the user to be
>>displayed in "Image1", the following doesn't work!
>>--
>>set the text of image "Image1" to it
>>end mouseUp
>>
>>Could anyone tell me how to acheive this?
>
>yes, you have two options:
>1. reference the image, just set the filename...
>2. copy that image into your stack
>
>on mouseUp
>    answer file "Please select an Image"
>    put it into field "FilePathName"
>    ##1.
>    set the filename of img "Image1" to it
>
>    ##OR
>    ##2.
>    ## put url("binfile:" & it) into img "Image1"
>end mouseUp
>
>Hope that helps.
>
>>Thanks a lot
>>Dave
>
>Regards
>
>Klaus Major
>[hidden email]
>http://www.major-k.de
>
>_______________________________________________
>use-revolution mailing list
>[hidden email]
>http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Associating a file with an Image Object

Eric Chatonet
Hi David,

 From the docs:
Some picture formats (such as TIFF) that are not supported by the  
image object can be displayed instead by QuickTime. To display a  
picture using QuickTime, you create a player instead of an image,  
then set the player’s filename, to display the picture file.

Le 14 juin 05 à 14:15, David Burgun a écrit :

> Thanks for that! It now works for JPEG files but not TIFF for some  
> reason, do you have to do something special to attach a TIFF file  
> to an Image Object?

Best regards from Paris,

Eric Chatonet.
----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Plugins, tutorials and more on our website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        [hidden email]/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------

_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: value function fails for multi-line input

Robert Brenstein
In reply to this post by Pat Trendler
>Dick,
>
>"a" is a string not the variable a
>either of the following lines will work:
>
>put value (a) & cr & (b)
>put value (a) & cr & value (b) into c; put value(c)
>
>But, really, you can just say:
>
>put a & cr & b into c
>put c
>
>Pat
>[hidden email]

"a" is a reserved word in Transcript and using it as a variable works
haphazardously, some times it does but mostly it doesn't. Not sure if
this has anything to do with the reported problem, though, but worth
checking.

Robert
_______________________________________________
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: value function fails for multi-line input

Dick Kriesel
In reply to this post by Pat Trendler
Thanks, Pat, for the suggestions about the examples I posted.  But the
examples are just simple recipes to reproduce the failure.

Actually I have handlers that generate much more involved expressions.  I
need those expressions evaluated in the context of particular objects that
the handlers identify.  So I tried the "value(expression,object)" syntax.
But that fails when the expression includes a multi-line string.

The "value(expression,object)" syntax seems to be the functional analog of
the "send message to object" syntax.  The message parameter of the send
command supports multi-line strings; so, I think, should the expression
parameter of the value function.

So the work-around for this failure of the value function is generating a
message instead of an expression, then sending the message and getting the
result.  I think the language designers intended to make the extra step
unnecessary.

-- Dick


_______________________________________________
use-revolution mailing list
[hidden email]
http://lists.runrev.com/mailman/listinfo/use-revolution