thanx, i decided to use your second suggestion
since i would delete the file when done anyway, easier to just not even have one

I think the problem is that the "get" you are using is asynchronous, and the socket has not downloaded the file by the time you are trying to access it. In fact, it may never download the file as the socket itself is a local variable, and goes out of scope at the end of your method.

I think you have two choices:

1. Use a socket that will persist after your method is done - either an httpSocket control in your window or an instance of a httpSocket subclass. In this case, you'll need to move your code that handles the downloaded file into the "downloadComplete" event of the socket which, as the name implies, will fire when the file has actually been downloaded.

2. Don't use a file at all. Instead make the get synchronous, and assign the result to a string, making your method look like this:

  dim http as new HTTPSocket
  dim s1, s2, s3 as String
  dim timeOutValInSeconds as integer

  timeoutValInSeconds = 10  //or whatever is reasonable

    // make status arrows visible
  pw.Visible = true

s1 = http.Get("http://www.kage-software.com/downloads/files/ CTversion.txt", timeOutValInSeconds)

  s3 = s1.Replace("version=", "")

  s2 = str(App.MajorVersion) + "." + str(App.MinorVersion)
  s2 = s2 + "." + str(App.BugVersion)
  if s3 = s2 then
    ef.text = "You have the latest version."
  else
    ef.text = "New version is available." + EndOfLine + s1
  end if

    // hide status arrows
  pw.Visible = false


On Mar 26, 2006, at 5:09 PM, Brian wrote:

I am trying to set up an update method
it downloads a text file with a version number
then checks that against the current version and prompts to update

It downloads and saves just fine but when i try to read from it
string s1 has no value


SNIP
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to