there is more than one item with the same name error

  1. 4 months ago

    David C

    Aug 10 Boston, MA

    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 ....

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

  2. Dave S

    Aug 10 San Diego, California USA

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

  3. Ivan T

    Aug 10 Pre-Release Testers
    Edited 4 months ago

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

  4. David C

    Aug 10 Boston, MA

    DownloadContent is the name of the sub Class I believe

    DownloadContent is under the same Window as Keydown.

  5. Dave S

    Aug 10 San Diego, California USA
    Edited 4 months ago

    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

  6. David C

    Aug 10 Boston, MA

    -image-

    please see example image

  7. Dave S

    Aug 10 San Diego, California USA

    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.....

  8. Julian S

    Aug 10 Pre-Release Testers, Xojo Pro Answer UK

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

  9. David C

    Aug 10 Boston, MA
    Edited 4 months ago

    Julian,
    The .ToText worked that was the problem.

    Thank you

    Dave

  10. I think I see: It is receiving URL.text which needs to be converted "to.text".

  11. Hans v

    Aug 11 Pre-Release Testers, Xojo Pro Soest, NL

    I guess API 2.0 should clarify this. ;-)

or Sign Up to reply!