Page 1 of 2

weird and severe language issue

Posted: Sun Nov 08, 2015 10:43 am
by jawall
Good morning,

I came across what to my stack is a very severe and extremly odd issue.

In my code the variable kurs contains something like "2015/16-1, 9k1-Mu"

Code: Select all

put kurs 
results in "2015/16-1, 9k1-Mu"

Code: Select all

answer kurs 
results in "2"

The issue appeared just recently. I tried several older LiveCode Editions, always the same.

Any ideas?

Thank you

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 10:50 am
by bn
Hi Jawall,

when I put this code into a button

Code: Select all

on mouseUp
   put "2015/16-1, 9k1-Mu" into kurs
   put kurs
   answer kurs
end mouseUp
it works just as expected. In LC 7.1.1 rc1

Could you post a script that reproduces the behavior you describe?

Which version of LC do you use and which operating system?

Kind regards
Bernd

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 10:55 am
by jawall
Hi Bernd,

thank you very much!

as I said, it used to work here, too....

It is impossible to post relevant part of the code since the stack is really heavily scripted and there are many interdependencies. I wish I coul, but nothing of my code, other than what I already posted, would make sense to anybody.

What I am going to try is
a) check with another operation system (I have another Mac here)
b) check with a simple stack

Thank you, I will come back on the issue in a few minutes.

Jürgen

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 11:02 am
by jawall
I checked with a simple stack

Code: Select all

on mouseUp
   put "2015/16-1, 9k1-Mu" into kurs
   put kurs
   answer Kurs
end mouseUp
It works as expected. So it cannot be an issue of LiveCode version or Mac OS version. It must have to do with my stack code. But how can that be? It should be impossible to alter the behavior of how "answer" and "put" see and return what is inside a variable?

Jürgen

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 11:08 am
by jawall
Further info:

In my stack
Version A

Code: Select all

   put "2015/16-1, 9k1-Mu" into kurs
   put kurs
   answer kurs
works


Version B

Code: Select all

   put the selectedtext of fld "Kurse"  into kurs
   put kurs
   answer Kurs
results in the behavior I wrote about.

Somehow

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 11:16 am
by bn
Hi Jürgen,

are there any "funny/invisible" characters in field "Kurse"? Where does the content of field "Kurse" come from? How do you fill field "Kurse"?

Kind regards

Bernd

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 11:30 am
by jawall
Bernd,

no invisible or funny characters other than what I already posted and the return character between lines.

The fld "Kurse" is filled in a process that is much prior to reading it.
Initially it is filled by hand, I mean, typed in.

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 11:34 am
by bn
Hi Jürgen,

could you set a breakpoint right before "answer" and look what is in variable "kurs" ?

Kind regards
Bernd

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 11:46 am
by jawall
I am in shame: I have worked with HyperCard and then LiveCode for about 20 years, coding highly complex stuff, but I never worked with debug mode, breakpoints and such - I just, don't know how to do that....

... Yes, I know! :oops:

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 12:02 pm
by bn
Hi Jürgen,

in Menu Development check "Script Debug Mode". Then you can either click in the handler you want to check left of the text and a red bullet appears (this is where the handler will stop and the debugger opens) or type "breakpoint" above the line of script you want to check in the debugger. The debugger has a pane "Variables" this is where you want to look. You can hover over the variable and it should show its content. Or you look in the variable pane and find your variable and to the right is the content of the variable. If the content is multi-line you can double- click on the value and a new window will open and show the complete content of the variable.

I remember when Hypercard did not have a debugger and I sprinkeld "play boing" etc over the code... :)

The debugger is really a big help if you want to know what is going on in your script

Kind regards
Bernd

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 12:10 pm
by jawall
Hey, Bernd,

you are very nice, indeed.

I did breakpoint the script and the variable kurs contains just wht is is supposed to contains in the variable watcher: "2015/16-1, 10k6-En"

BUT
When I copy and pasted the variables contents here into this post it read: " 015/16-1, 10k6-En"
Is that normal behavior? I mean "2" was what my answer dialog came up with and "2" is what is missing when I copy and pasted the variable here.

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 12:16 pm
by bn
Hi Jürgen,

could you do

Code: Select all

on mouseUp
   put the selectedChunk of field "Kurse" into tSelected
   put the htmlText of tSelected into field "anotherField"
end mouseUp
and post the text of field "anotherField"?

Kind regards
Bernd

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 12:37 pm
by jawall
I did

<p><font color="#000000">2015/16-1, 9k1-Mu</font></p>

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 12:47 pm
by bn
Hi Jürgen,

the htmlText is ok.

As far as I understand you could now post a stack with the field and your button that shows the behavior.

You have to zip the stack and then use the "Upload attachment" tab and don't forget to "Add file" after you have chosen your zip to upload.

I am running out of ideas what is could be the problem without seeing a stack that behaves the way you describe.

Kind regards
Bernd

Re: weird and severe language issue

Posted: Sun Nov 08, 2015 12:52 pm
by jawall
hi bernd,

there is a problem. the data in the stack contains students and grades with fotos and addresses. I can't post that here. I could send it to you via mail an give you instructions on where to find the code and how to reproduce the error

But I will take a little and you would have to send your address, mine is (SORRY; deleted for safety reasons)

Jürgen