Question about the result

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about the result

J. Landman Gay via use-livecode
Hi list

According to LC dictionary, the result "Returns the status of the last
command that was executed". But I had 2 unexpected experiences on my
on-rev account recently :
1- a line such as
   put URL ("http://mydomain.com/index.php?" & it) into myVar
never went through (because it was corrupted : contained some extra
characters such as ascii 10), however the result remained empty.

2- when trying to create a zip archive
   revZipOpenArchive "home/myaccount/public_html/dir1/dir2/dir3", "write"
the name of directory "dir2" had been changed and therefore "dir3" could
not be found; however the result remained empty.

I know that in the 2nd case I could use the sysError function, but
according to the doc, the result shouldn't be empty anyway...
So my question : am I expecting too much from the result, like containing
some useful error message every time something doesn't work as expected ?

Thanks in advance.
jbv


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
In the first case, I would check all 3 locations.. Since i'm assuming the
first part of the url (yourdomain.com/index.php?) is correct, the put URL
is most likely succeeding in connecting to the url, so you would need to
look at the contents of myVar to see what if anything was actually
returned.  In a case where the url is actually able to be hit, 'the result'
will be empty, but the value returned from the server may be invalid data.
It still wouldn't hurt to look at "it" also, IIRC sometimes useful info
will appear there. (though in this case, my guess is that garbled info is
in myVar)  Of course, if the url is invalid, then the result should tell
you so.

As for the second.. If I test from the message box, revzipopenarchive seems
to do pretty much.. um.. Nothing.  Doesn't open an archive, doesn't return
an error message.. Nothing in it, or the result.. Weird.  So I put code in
a button and things behaved as expected. (when specifying a path with no
permissions, the result told me so.  Same with an invalid path.  (this is
on 9 dp 11)

No clue why it won't work from the message box, or if its related to what
happened on your end.

On Sun, Feb 25, 2018 at 6:50 AM, jbv via use-livecode <
[hidden email]> wrote:

> Hi list
>
> According to LC dictionary, the result "Returns the status of the last
> command that was executed". But I had 2 unexpected experiences on my
> on-rev account recently :
> 1- a line such as
>    put URL ("http://mydomain.com/index.php?" & it) into myVar
> never went through (because it was corrupted : contained some extra
> characters such as ascii 10), however the result remained empty.
>
> 2- when trying to create a zip archive
>    revZipOpenArchive "home/myaccount/public_html/dir1/dir2/dir3", "write"
> the name of directory "dir2" had been changed and therefore "dir3" could
> not be found; however the result remained empty.
>
> I know that in the 2nd case I could use the sysError function, but
> according to the doc, the result shouldn't be empty anyway...
> So my question : am I expecting too much from the result, like containing
> some useful error message every time something doesn't work as expected ?
>
> Thanks in advance.
> jbv
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
Mike
Thanks for your reply.
Actually, in the 2 cases I mentioned, I was able to find the origin of the
problem.
The only point I was trying to make is that each time the result was of no
help since it remained empty.

On Sun, February 25, 2018 3:48 pm, Mike Bonner via use-livecode wrote:

> In the first case, I would check all 3 locations.. Since i'm assuming the
>  first part of the url (yourdomain.com/index.php?) is correct, the put
> URL
> is most likely succeeding in connecting to the url, so you would need to
> look at the contents of myVar to see what if anything was actually
> returned.  In a case where the url is actually able to be hit, 'the
> result' will be empty, but the value returned from the server may be
> invalid data. It still wouldn't hurt to look at "it" also, IIRC sometimes
> useful info will appear there. (though in this case, my guess is that
> garbled info is in myVar)  Of course, if the url is invalid, then the
> result should tell you so.
>
> As for the second.. If I test from the message box, revzipopenarchive
> seems to do pretty much.. um.. Nothing.  Doesn't open an archive, doesn't
> return an error message.. Nothing in it, or the result.. Weird.  So I put
> code in a button and things behaved as expected. (when specifying a path
> with no permissions, the result told me so.  Same with an invalid path.
> (this is
> on 9 dp 11)
>
> No clue why it won't work from the message box, or if its related to what
>  happened on your end.
>
> On Sun, Feb 25, 2018 at 6:50 AM, jbv via use-livecode <
> [hidden email]> wrote:
>
>> Hi list
>>
>>
>> According to LC dictionary, the result "Returns the status of the last
>> command that was executed". But I had 2 unexpected experiences on my
>> on-rev account recently : 1- a line such as
>> put URL ("http://mydomain.com/index.php?" & it) into myVar never went
>> through (because it was corrupted : contained some extra characters such
>> as ascii 10), however the result remained empty.
>>
>> 2- when trying to create a zip archive
>> revZipOpenArchive "home/myaccount/public_html/dir1/dir2/dir3", "write"
>> the name of directory "dir2" had been changed and therefore "dir3"
>> could not be found; however the result remained empty.
>>
>> I know that in the 2nd case I could use the sysError function, but
>> according to the doc, the result shouldn't be empty anyway... So my
>> question : am I expecting too much from the result, like containing some
>> useful error message every time something doesn't work as expected ?
>>
>> Thanks in advance.
>> jbv
>>
>>
>> _______________________________________________
>> use-livecode mailing list [hidden email] Please visit this
>> url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
> _______________________________________________
> use-livecode mailing list [hidden email] Please visit this
> url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
Ah, well the only useful part of my answer then would regard the first
issue. The result remaining empty was the correct response because the base
url was valid, so the command didn't fail to connect to the url, and no 404
type or other type errors were returned as part of the headers.

As for the other part, if anyone can educate me.. Why doesn't
revzipopenarchive work from the message box (at all) but works fine in a
script. Rather frustrating to test something in the msg box and have it
misbehave simply because its coming from the msg box.

On Sun, Feb 25, 2018 at 8:26 AM, jbv via use-livecode <
[hidden email]> wrote:

> Mike
> Thanks for your reply.
> Actually, in the 2 cases I mentioned, I was able to find the origin of the
> problem.
> The only point I was trying to make is that each time the result was of no
> help since it remained empty.
>
> On Sun, February 25, 2018 3:48 pm, Mike Bonner via use-livecode wrote:
> > In the first case, I would check all 3 locations.. Since i'm assuming the
> >  first part of the url (yourdomain.com/index.php?) is correct, the put
> > URL
> > is most likely succeeding in connecting to the url, so you would need to
> > look at the contents of myVar to see what if anything was actually
> > returned.  In a case where the url is actually able to be hit, 'the
> > result' will be empty, but the value returned from the server may be
> > invalid data. It still wouldn't hurt to look at "it" also, IIRC sometimes
> > useful info will appear there. (though in this case, my guess is that
> > garbled info is in myVar)  Of course, if the url is invalid, then the
> > result should tell you so.
> >
> > As for the second.. If I test from the message box, revzipopenarchive
> > seems to do pretty much.. um.. Nothing.  Doesn't open an archive, doesn't
> > return an error message.. Nothing in it, or the result.. Weird.  So I put
> > code in a button and things behaved as expected. (when specifying a path
> > with no permissions, the result told me so.  Same with an invalid path.
> > (this is
> > on 9 dp 11)
> >
> > No clue why it won't work from the message box, or if its related to what
> >  happened on your end.
> >
> > On Sun, Feb 25, 2018 at 6:50 AM, jbv via use-livecode <
> > [hidden email]> wrote:
> >
> >> Hi list
> >>
> >>
> >> According to LC dictionary, the result "Returns the status of the last
> >> command that was executed". But I had 2 unexpected experiences on my
> >> on-rev account recently : 1- a line such as
> >> put URL ("http://mydomain.com/index.php?" & it) into myVar never went
> >> through (because it was corrupted : contained some extra characters such
> >> as ascii 10), however the result remained empty.
> >>
> >> 2- when trying to create a zip archive
> >> revZipOpenArchive "home/myaccount/public_html/dir1/dir2/dir3", "write"
> >> the name of directory "dir2" had been changed and therefore "dir3"
> >> could not be found; however the result remained empty.
> >>
> >> I know that in the 2nd case I could use the sysError function, but
> >> according to the doc, the result shouldn't be empty anyway... So my
> >> question : am I expecting too much from the result, like containing some
> >> useful error message every time something doesn't work as expected ?
> >>
> >> Thanks in advance.
> >> jbv
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list [hidden email] Please visit
> this
> >> url to subscribe, unsubscribe and manage your subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >>
> > _______________________________________________
> > use-livecode mailing list [hidden email] Please visit
> this
> > url to subscribe, unsubscribe and manage your subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
On Sun, February 25, 2018 5:36 pm, Mike Bonner via use-livecode wrote:
> Ah, well the only useful part of my answer then would regard the first
> issue. The result remaining empty was the correct response because the
> base url was valid, so the command didn't fail to connect to the url, and
> no 404 type or other type errors were returned as part of the headers.
>

Actually, when I wrote "never went through", that's exactly what happened :
the request never went through, the server never received that request and
therefore never returned anything. And even more surprising, the line
   put URL ("http://mydomain.com/index.php?" & it) into myVar
didn't block the execution of the script and the following lines were
executed,
and myVar was empty.

That's the reason why I was surprised to see that the result was empty as
well;
I would expect something like "data corrupted" or "impossible to send
request"...
And also to have the script blocked by that line...



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
That is rather strange.  Most of the time LC is exactly what I expect, but
then there are those head scratcher issues that keep me flummoxed. <--
(word of the day)

On Sun, Feb 25, 2018 at 9:57 AM, jbv via use-livecode <
[hidden email]> wrote:

> On Sun, February 25, 2018 5:36 pm, Mike Bonner via use-livecode wrote:
> > Ah, well the only useful part of my answer then would regard the first
> > issue. The result remaining empty was the correct response because the
> > base url was valid, so the command didn't fail to connect to the url, and
> > no 404 type or other type errors were returned as part of the headers.
> >
>
> Actually, when I wrote "never went through", that's exactly what happened :
> the request never went through, the server never received that request and
> therefore never returned anything. And even more surprising, the line
>    put URL ("http://mydomain.com/index.php?" & it) into myVar
> didn't block the execution of the script and the following lines were
> executed,
> and myVar was empty.
>
> That's the reason why I was surprised to see that the result was empty as
> well;
> I would expect something like "data corrupted" or "impossible to send
> request"...
> And also to have the script blocked by that line...
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
It would be nice if we had more consistent locations to check for feedback,
without special cases and provisos.  For example, returning a value from a
function and a command (forget "for value" and "for error") populate it or
the result depending on whether we are using a command or a function.  One
of the side effects of adding "for value" and "for result" is that some of
the error reporting we used to receive if we coded for the incorrect
handler type has gone away.

On Sun, Feb 25, 2018 at 12:20 PM, Mike Bonner via use-livecode <
[hidden email]> wrote:

> That is rather strange.  Most of the time LC is exactly what I expect, but
> then there are those head scratcher issues that keep me flummoxed. <--
> (word of the day)
>
> On Sun, Feb 25, 2018 at 9:57 AM, jbv via use-livecode <
> [hidden email]> wrote:
>
> > On Sun, February 25, 2018 5:36 pm, Mike Bonner via use-livecode wrote:
> > > Ah, well the only useful part of my answer then would regard the first
> > > issue. The result remaining empty was the correct response because the
> > > base url was valid, so the command didn't fail to connect to the url,
> and
> > > no 404 type or other type errors were returned as part of the headers.
> > >
> >
> > Actually, when I wrote "never went through", that's exactly what
> happened :
> > the request never went through, the server never received that request
> and
> > therefore never returned anything. And even more surprising, the line
> >    put URL ("http://mydomain.com/index.php?" & it) into myVar
> > didn't block the execution of the script and the following lines were
> > executed,
> > and myVar was empty.
> >
> > That's the reason why I was surprised to see that the result was empty as
> > well;
> > I would expect something like "data corrupted" or "impossible to send
> > request"...
> > And also to have the script blocked by that line...
> >
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
This is a long standing gripe by some. Many functions return empty if no error was encountered. As previously mentioned, if you were able to contact a URL and it returned data, then from the engine's perspective, there was no error.

Some have suggested a feature/fix to the result that it would always return something, instead of just empty, but that would require a great deal of refactoring by everyone who's code checks the result in any way. That kind of change is like pulling the last tooth from a ravenous lion. Who will perform the surgery, and then suffer the ire of the general LC community?

There would have to be some other variable that was returned instead, like the realresult or the extendedresult (extresult) or the result ["successmsg"].

Bob S


> On Feb 25, 2018, at 07:26 , jbv via use-livecode <[hidden email]> wrote:
>
> Mike
> Thanks for your reply.
> Actually, in the 2 cases I mentioned, I was able to find the origin of the
> problem.
> The only point I was trying to make is that each time the result was of no
> help since it remained empty.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
That is curious. I actually get data back from that exact URL! I know you were using my domain.com as a placeholder, but that domain is a real one!

Bob S


> On Feb 25, 2018, at 05:50 , jbv via use-livecode <[hidden email]> wrote:
>
> put URL ("http://mydomain.com/index.php?" & it) into myVar


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Question about the result

J. Landman Gay via use-livecode
In reply to this post by J. Landman Gay via use-livecode
Ohay when I substitute bobbybleh.com for the domain, I get:

tsneterr: (6) Could not resolve host: bobbybleh.com

in the result.

Bob S


> On Feb 25, 2018, at 05:50 , jbv via use-livecode <[hidden email]> wrote:
>
> put URL ("http://mydomain.com/index.php?" & it) into myVar


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode