there is more than one item with the same name error

Under a window, I set up a Class called DownloadContent it’s super class is “Xojo.Net.HTTPSocket”

upon a key stroke i download a url content.

if Key = Chr(13) Then DownLoadContent.Send("GET", URL.text) End if

i keep getting an error saying
“there is more than one item with this name and it’s not clear which this refers”

but i have changed the name many times and still get the error.

please advise …

where and how is that object instantiated? is it in the same scope as the keydown?

DownLoadContent Is the name of the CLAsS or the name of an instance?

DownloadContent is the name of the sub Class I believe

DownloadContent is under the same Window as Keydown.

you cannot refer to the CLASS Name… you must create an instance and use that

dim myDLC = new DownloadContent
if Key = Chr(13) Then
      myDLC.Send("GET", URL.text)
End if

this is an example… the creation of the instance may need to be elsewhere in your code

please see example image

ok…we are trying to help but you don’t seem to want it… I understand your “picture” but without the rest of the context it is a minor part of the equation…

if Key = Chr(13) Then
DownLoadContent.Send(“GET”, URL.text.ToText)
End if

Julian,
The .ToText worked that was the problem.

Thank you

Dave

I think I see: It is receiving URL.text which needs to be converted “to.text”.

I guess API 2.0 should clarify this. :wink: