What does this error mean??

Because the weblink control does not work properly i.e.:it cuts off the top half of its text and requires a double click to trigger a mouse down event, I have had to resort to using a web button to jump to another page. When I use the command mywebbutton.showURL("www.google.com"), I get a compile error that reads “this method cannot accept an assigned value (it lacks an Assigns parameter).” Can anybody indicate what this error means. I have tried to use a variable to point to the desired URL, but I still get the same compile error.

Put ShowURL(“www.google.com”) in the mywebbutton.Action event :slight_smile:

Tried that, same error

Hmm. Did you create the action event and then add the code inside it? Should work.

You are assigning a value to a method, like that:

anInstance.aMethod = 123 anInstance.aMethodWithMoreParams("abc", 987) = 123
You can change a Method to work like that with the Assigns keyword:

Sub aMethod(Assigns anInt As Integer) Sub aMethodWithMoreParams(aText As String, anInt As Integer, Assigns aSecondInt As Integer)
Assigns is how Xojo implements properties like ListBox.Selected – it is not really a property, it is a method (ListBox.Selected):

[quote]ListBox.Selected ( row as Integer ) = aBooleanValue[/quote]is actually:

ListBox.Selected ( row As Integer, Assigns value As Booean )

Hi Ablin, this should be pretty straight forward(you would think). Can you try it at your end and tell me what results you get. In the mean time, I will try Eli’s suggestion

you’re right it is easy
here http://great-white-software.com/miscellaneous/webshowurl.xojo_binary_project.zip
the button has its action event implemented that says

showURL(“http://www.google.com”)

[quote=193146:@Norman Palardy]you’re right it is easy
here http://great-white-software.com/miscellaneous/webshowurl.xojo_binary_project.zip
the button has its action event implemented that says

showURL(“http://www.google.com”)[/quote]
Astonishing!! it actually works. It appears that not naming the control and including ‘http://’ appears to fix the problem. My thanks to all Canucks named Norman on this forum

without seeing what you did its hard to tell whats wrong with what you tried
There are several variations that all work

  1. the one I posted which calls the GLOBAL method “showurl”
  2. in the action event of a button on a web page you can put Me.ShowURL(“http://www.wikipedia.org”, True)
  3. in the action event of a button, say you called it button1, on a web page you can put button1.ShowURL(“http://www.wikipedia.org”, True)

and there are even a couple more variations on this and all work as I expect

So I am REALLY curious what your code looked like, where it was, basically a sample that contained what wasn’t working for you

[quote=193154:@Norman Palardy]without seeing what you did its hard to tell whats wrong with what you tried
There are several variations that all work

the one I posted which calls the GLOBAL method “showurl”
in the action event of a button on a web page you can put Me.ShowURL(“http://www.wikipedia.org”, True)
in the action event of a button, say you called it button1, on a web page you can put button1.ShowURL(“http://www.wikipedia.org”, True)
and there are even a couple more variations on this and all work as I expect

So I am REALLY curious what your code looked like, where it was, basically a sample that contained what wasn’t working for you[/quote]

I am REALLY curious to see what I did wrong as I can’t replicate the error now (“thats convenient he mutters”).
Here was the offending code;

[code]dim aURL as string

aurl=“http://www.xe.com/currencyconverter/convert/?Amount=26&From=EUR&To=”+curr.text

button2.showURL(aurl)
[/code]
Where curr.text is a 3 letter currency code in a drop down list. The amount ‘26’ is hard coded until the method of showing a currency conversion is working as expected.

As you scrape that page please keep this in mind:

<!-- WARNING: Automated extraction of rates is prohibited under the Terms of Use. -->

Thanks for the warning Bob, but directing somebody to a currency conversion site is not exactly illegal.

Sorry! Obviously I wasn’t thinking clearly. I saw ShowURL and thought HTTPSocket.Get. I’ll just step out of this conversation now.

[quote=193157:@Bob Coleman]As you scrape that page please keep this in mind:

<!-- WARNING: Automated extraction of rates is prohibited under the Terms of Use. -->

Well, so far he is just merely trying to show the page :wink:

Yup, see the two posts above yours.