libURLSetStatusCallback: is there a simpler way?

2007-02-19 Thread David Bovill

I am getting errors with fetching data from a web server. The symptoms
are:

On occassion put url someURL in someXML return empty - that is someXML is
empty. This happens when I click a couple of times on different items in the
GUI in succession resuling in an error.

I think though it is hard to debug, that this is because I am using load
and mixing these calls with blocking call like the above when I want to get
the data now.

I am sure I read somewhere in the docs that multiple calls to the same URL
can cause problems - is this right ??? In which case I should do a check
with urlstatus(someURL) before calling the url?

URLStaus?
Well if this is the cause of the problem I could not fix it - as AFAIK
urlstatus(someURL) only allows you to check the status of a url you know. In
my case the previous url would be different from the one I am about to call
- that is the script is about to check:

   www.mydomain/new.cgi

and I have a number of

   load url http://www.mydomain/someimage.png;

in progress. My guess is that because they share the same domain - the call
to the cgi is returning empty - but that I cannot check the urlstatus before
the call to the cgi as the urlstatus of new.cgi is empty and without
tracking all the load calls in my script there is no way to find out how
many urls are currenty loading but no finished loading - this is surely a
deficiency of the urlstatus function?

The hard way?
Before embarking on this I thought I would check in to see if there is an
easier way... but this is what I am thinking of doing...

If I set libURLSetStatusCallback then I could effectively log all calls to
urls that are in the process of loading but not in the cache yet. That is
the following status commands would be (effectively) sent back from the
server:

queued: on hold until a previous request to the same site is completed

contacted: the site has been contacted but no data has been sent or
received yet
requested: the URL has been requested




And I could then store the urls of the pending urls yet to be cached by the
load function?

The easy way?
It would seem there must be an easier way? Am I right about the source of
the error?
The only other way I can think of doing this is simply not to mix load and
get url... from the same server. If I used another load if would be
place in th cue. However then I loose my ability to prioritize calls to
certain urls and all 500 thumbnails would have to load before a user click
shows the full image...
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


libURLSetStatusCallback

2006-11-09 Thread jhonken
Dave,
  Thanks that works great.  I'm still not understanding how the
libUrlSetStatusCallback works.  I've been reading the docs and I keep
getting an error with the following test code:
 
libURLSetStatusCallback myProgress,the long ID of me

go stack URL http://www.x12help.com/mystack.rev; in a new window

put myProgress into fld tester

 

I have a button that is executing the code above and an empty field
called tester.  From what I've read I think the messages is going into
MyProgress which I think I should be able to put out to a field or
progress bar.  I keep getting the error below.  I'd appreciate any help
I could get.  Jeff

executing at 9:45:37 AM

Type Chunk: no such object

Object Monitor

Line put myProgress into fld tester

Hint tester

 


On 8 Nov 2006, at 22:04, jhonken wrote:

 How would you catch an error with the Go Stack URL if the URL was  
 non
 existant would you use the URLStatus?

 Also can you combine the Go Stack URL with the URLStatus and  
 feed it
 to a progrress bar?

You won't be able to use urlStatus, but you can use  
libUrlSetStatusCallback to track the progress.

As for checking errors, it is probably easier to check the result.

go stack url myUrl
put the result into tRes
if tRes is not empty then
   answer tRes
end if

Cheers
Dave

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: libURLSetStatusCallback

2006-11-09 Thread Dave Cragg


On 9 Nov 2006, at 14:55, jhonken wrote:


Dave,
  Thanks that works great.  I'm still not understanding how the
libUrlSetStatusCallback works.  I've been reading the docs and I keep
getting an error with the following test code:

libURLSetStatusCallback myProgress,the long ID of me

go stack URL http://www.x12help.com/mystack.rev; in a new window

put myProgress into fld tester



I have a button that is executing the code above and an empty field
called tester.


myProgress is the name of a handler (message). Try something like this:

on mouseUp
  libURLSetStatusCallback myProgress,the long ID of me
  go stack URL http://www.x12help.com/mystack.rev;
end mouseUp


on myProgress pUrl, pStatusString
  put pStatusString into field tester
end myProgress

Cheers
Dave
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: libURLSetStatusCallback

2006-11-09 Thread jhonken
Dave,
  Again that worked great.  I'm going to try to feed it into a progress
bar next.  Jeff

-Original Message-
From: Dave Cragg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 09, 2006 10:53 AM
To: How to use Revolution
Subject: Re: libURLSetStatusCallback



On 9 Nov 2006, at 14:55, jhonken wrote:

 Dave,
   Thanks that works great.  I'm still not understanding how the 
 libUrlSetStatusCallback works.  I've been reading the docs and I keep

 getting an error with the following test code:

 libURLSetStatusCallback myProgress,the long ID of me

 go stack URL http://www.x12help.com/mystack.rev; in a new window

 put myProgress into fld tester



 I have a button that is executing the code above and an empty field 
 called tester.

myProgress is the name of a handler (message). Try something like this:

on mouseUp
   libURLSetStatusCallback myProgress,the long ID of me
   go stack URL http://www.x12help.com/mystack.rev;
end mouseUp


on myProgress pUrl, pStatusString
   put pStatusString into field tester
end myProgress

Cheers
Dave
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution