LC 8 - RC 1 on Windows 10 - Old scripts failing

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderator: Klaus

Post Reply
Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by Geoff.Macumber » Mon May 02, 2016 4:51 am

Hi everyone,

I have been using LC for almost three years now and have upgraded to later versions several times without too much trouble. I have just recently upgraded to LC8-RC1 as I needed to use a couple of the new widgets (browser and others). I came across a couple of problems in old code that hasn't changed in quite a while.

- First problem was that I had to change most of my usage of char to byte, and offset to byteOffset. According to the dictionary the behaviour is slightly different although it has never actually caused a problem using char before. As soon as I got to LC8 about half of my char uses started failing. Got around that OK by changing to byte and byteOffset as I mentioned.

- Second and more serious problem. I do a lot of text handling and use replace extensively. I now find that some code that has been running fine for a couple of years is now failing and I cannot figure out why. Is there a change in the way the replace works? The code is involved in emulating some PICK/Universe/openQM functions for date handling. One example code segment is as follows...

put "D4/EP" into anyVariable
... other code here ...
replace "D" with "" in anyVariable ............... result in anyVariable is "D4/EP" - "D" is NOT replaced
... other code here ...
replace "4" with "" in anyVariable ............... result in anyVariable is "D/EP" - "4" is replaced OK
... other code here ...
replace "E" with "" in anyVariable ............... result in anyVariable is "D/EP" - "E" is NOT replaced
... other code here ...
replace "P" with "" in anyVariable ............... result in anyVariable is "D/EP" - "P" is NOT replaced
... other code here ...

Has the behaviour of the replace command changed? Does anyone have any ideas?

regards Geoff Macumber.

Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

Re: LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by Geoff.Macumber » Mon May 02, 2016 6:36 am

Further to this I found that I could do the following and it would then work OK...

put "D4/EP" into anyVariable
... other code here ...
put anyVariable into AnotherVariable
replace "D" with "" in anotherVariable ............... result in anotherVariable is "4/EP" - "D" is replaced OK
put AnotherVariable into anyVariable
... other code here ...
replace "4" with "" in anyVariable ............... result in anyVariable is "D/EP" - "4" is replaced OK
... other code here ...
replace "E" with "" in anyVariable ............... result in anyVariable is "D/EP" - "E" is replaced OK
... other code here ...
replace "P" with "" in anyVariable ............... result in anyVariable is "D/EP" - "P" is replaced OK
... other code here ...

it appears that moving the value to a different variable, do the replace in the new variable and then return it to the original variable fixes some internal pointer (or something) and then all is fine. The card that is using the function containing the above code contains a browser widget. It seems to have made a couple of things a bit hazy...

Regards Geoff Macumber.

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm

Re: LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by peter-b » Mon May 02, 2016 11:25 am

Sorry to hear that you're having problems. Do you mind filing a bug report with a description of the problems you're having and, if possible, a stack that we can run to observe the problem? Unfortunately your description here isn't enough for me to be able to see what's happening... I can always get "replace" to work properly!
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

Re: LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by Geoff.Macumber » Tue May 03, 2016 12:47 am

Hi peter-b,

It's a difficult one to pin down. If i set up a separate stack or put this code into a different card then - no problem. It is only when the card that now contains a browser widget is active that the problem appears. As I said in my second post I have a work around. The stack that the card is a part of is "ginormous" - it is a very large security application so I'd rather not send the stack in question. I will try to duplicate the problem in a smaller stack and then put in a bug report.

Regards,
Geoff Macumber
:roll:

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm

Re: LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by peter-b » Tue May 03, 2016 9:56 am

Hi Geoff, That would be enormously helpful. We're also happy to look at your stack under an NDA if you aren't able to create a minimal test case. If you'd like to provide a confidential stackfile please contact panos.merakos@livecode.com.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

Re: LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by Geoff.Macumber » Wed May 04, 2016 12:42 am

Hi peter-b,

Thanks and I will get to it as fast as I can. We are about to do the first of hopefully many installations of our product so things are fairly hectic here.

As an aside I found another problem which I will raise a bug report for. It goes something like this...

put "" into Tmp
put byteOffset("eNDoFdATA",Tmp) into P
answer "P=" & P

You won't get to the "answer" statement if Tmp is null. I have similar code all over the place and sometimes the variable (in this case Tmp) contains nothing and byteOffset() crashes out of Livecode with no errors, warnings or anything. If I check with Task Manager there is no evidence that Livecode was even running.

Regards Geoff Macumber.
:(

Geoff.Macumber
Posts: 30
Joined: Tue Aug 12, 2014 7:15 am
Contact:

Re: LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by Geoff.Macumber » Wed May 04, 2016 1:00 am

Bug 17552 submitted for the byteOffset problem.

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm

Re: LC 8 - RC 1 on Windows 10 - Old scripts failing

Post by peter-b » Mon May 09, 2016 2:29 pm

Geoff.Macumber wrote:Bug 17552 submitted for the byteOffset problem.
Thanks for filing the bug report, Geoff! I've added it to the backlog of things for the development team to look into.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

Post Reply