Help with legacy on-rev site tripped up on new LiveCode hosting service
Alex Tweedly
alex at tweedly.net
Wed Mar 30 19:35:42 EDT 2016
Hi Martin,
it sounds like you've got your problems all fixed, but I thought I
should mention that there was a subtle change in 'global' behaviour at
some point in LC server evolution. It affected me when one of the
upgrades changed things so I was using a later version (maybe 3.5 up to
6.x ?? - that was fixed very quickly by David, a couple of years ago),
and then affected me again on the recent change to Liquidweb (and I
fixed it by changing my scripts to avoid the problem).
I don't know that I can easily explain it well, and I'm still trying to
decide if it's a bug or not :-) - but I do know it used to work and now
doesn't. Since I no longer have access to an older server, I haven't
been able to do a direct comparison.
I *think* of include files as though they were a simple file insertion -
but that's not actually how they work. The dictionary gives a (rather
opaque) description - the included file is "parsed and variables are
added to the global script context ..."
The following two files demonstrate the issue
b.lc
> <?rev
>
> include "b1.lc"
>
> put BAD
and
b1.lc
> <?rev
>
> global BAD
>
> on startup
> put "good" into BAD
> end startup
>
> startup
>
Now if it worked like a file/text operation, accessing mysite.com/b.lc
would produce "good" as output.
And (the way I read the dictionary description), I think it should do
the same, because:
the variable 'BAD' should be added to the global context,
then the handler is added there too,
then the handler is executed and should set the variable to 'good',
and then (back in the top-level file) it should be printed out.
However, what is printed currently (on sage) is "BAD" - i.e. as though
there was no such global variable.
Anyway - just in case you find there are less obvious problems resulting
in bad output rather than errors - you might want to check on the
order/placement of any global declarations.
-- Alex.
On 30/03/2016 05:25, Martin Koob wrote:
> Hi
>
> Thanks everyone for their comments.
>
> I managed to get it working. There were a number of issues with
> incompatibilities of LC server 4.6.4 scripts with the LiveCode 6.2.6 engine.
> With some help from Monte I managed to find and resolve the following
> issues.
> -one is that there was a global scope and with the same name as variables in
> several functions.
>
More information about the use-livecode
mailing list