# Nils - a bug in KSP Editor



## TuwaSni (May 4, 2011)

Nils - got your ears on? I was going to contact you about this on your site - but found no contact link there.

I downloaded the latest version of KSP Editor to try and debug a rather large script that K4 was belching and snorting on and which it gave no competent error message for. I loaded the text into KSP Editor and tried to compile it. I kept getting errors that centered on "set_control_help" statements. KSPE kept failing to parse the text correctly - as if it was confused and was trying to parse the text code as regular code statements - always seeming to glitch on capitalized words other than at the beginning of sentences. Just thought you should know.

TS


----------



## EvilDragon (May 5, 2011)

How about a selection of code that's seemingly triggering the error?


----------



## TuwaSni (May 10, 2011)

*Code selection that chokes KSPEd*



EvilDragon @ Thu May 05 said:


> How about a selection of code that's seemingly triggering the error?



set_control_help($Clear_Images,"Click to clear Images assignments. 2nd click clears. If Set Note active then clears current assignment - else
clears all assignments.")


Compiles fine in k4 - chokes on Set Note - says it hasn't been declared. Acts like it is interpreting text as if it is part of a coded "if" statement.

TS


----------



## EvilDragon (May 10, 2011)

How about:

set_control_help(get_ui_id($Clear_Images),...)


However something tells me that the error is somewhere before that line...


----------



## Big Bob (May 10, 2011)

Looks to me like you may have a carriage return code after the word 'else'. I tried it in the KSE both this way (with one long line), 

*on init*
``*declare* ui_button $Clear_Images
``set_control_help($Clear_Images,"Click to clear Images assignments. 2nd click clears. If Set Note active then clears current assignment - else clears all assignments.") 
*end on*


and this way to keep the line within a reasonable page size,


*on init*
``*declare* ui_button $Clear_Images
``set_control_help($Clear_Images,"Click to clear Images assignments. 2nd click clears. If Set Note" & ...
``````````````"active then clears current assignment - else clears all assignments.") 
*end on*




Both of these compile OK in the KSE and the result in the clipboard compiles and runs in K4.

And, Mario, I think the set_control_help command takes the control 'name', not the control id.

Rejoice,

Bob


----------



## EvilDragon (May 10, 2011)

Big Bob @ 10.5.2011 said:


> And, Mario, I think the set_control_help command takes the control 'name', not the control id.



Oh, quite true. Brain fart. :lol:


----------



## TuwaSni (May 10, 2011)

A CR causing the KSPE to belch and snort? Compiles just fine in K4.

TS


----------



## EvilDragon (May 10, 2011)

Can you send the whole code, so we can bugtrack? :lol:


----------



## Big Bob (May 10, 2011)

TuwaSni @ Tue May 10 said:


> A CR causing the KSPE to belch and snort? Compiles just fine in K4.
> 
> TS



Are you saying that just this single line of code (in the ICB) will not compile correctly in the KSE when you hit F5?

Why don't you copy the code I posted (either form) and paste it into the KSE, then hit F5. *When I do that it compiles just fine*. I don't know what your problem is but it sure isn't just this item. You can copy the code that I posted directly from the forum by highlighting it and hitting ctl-C (don't re-type it). What's in the clipboard will be accepted by the KSE (ctl-V) and should read correctly with syntax highlighting. Then, hit F5 and what happens?

When I copied your posted example, the text string had a CR in it (but maybe that crept in when you posted it?).

If you put only your original line of code for the *set_control_help *that you posted (between *on init *and *end on* of course) will it compile properly when you hit F5?

If just this single line of code doesn't compile in the KSE then you have something terribly wrong. :shock: 

Rejoice,

Bob


----------



## TuwaSni (May 11, 2011)

Big Bob @ Tue May 10 said:


> TuwaSni @ Tue May 10 said:
> 
> 
> > A CR causing the KSPE to belch and snort? Compiles just fine in K4.
> ...



Bob - No doubt about your reworked code compiling fine in KSE AND K4. This wasn't the only set_control_help that belched and farted in KSE. All of them compiled fine in K4 - even with CRLFs. I was hoping to use KSE as a troubleshooting tool (as we all know about the accuracy of K's KSP error messages) - but it appears that KSE has it's own problems. Just a data point. Just won't use it in the future. Thought I would try to give Nils a head's up on the incompatibility - didn't expect to get jumped on
and thrashed about.

TS


----------



## Big Bob (May 11, 2011)

> but it appears that KSE has it's own problems. Just a data point. Just won't use it in the future. Thought I would try to give Nils a head's up on the incompatibility - didn't expect to get jumped on
> and thrashed about.



Well I'm sorry you think I (we) were 'jumping on you' and 'thrashing you about' :shock: 

I'm also sorry that you are having trouble with the KSE but so far, you haven't been able to show us an example of anything that the KSE handles incorrectly. Just saying that you are having all kinds of glitches (pardon me if I don't repeat your terminology), doesn't give us much to go on. I don't know about Mario but, I can't read your mind so I don't know how you could have expected anyone to help you without giving us more info.

So, naturally, Mario asked you to post an example. Now you seem upset because the example you posted works OK when it's typed correctly. And, I guess now you are saying you want the KSE to work properly even when you make typing errors? :? 

Oh well, I guess the KSript Editor isn't right for everyone 8) 

Rejoice,

Bob


----------



## TuwaSni (May 11, 2011)

Big Bob @ Wed May 11 said:


> > but it appears that KSE has it's own problems. Just a data point. Just won't use it in the future. Thought I would try to give Nils a head's up on the incompatibility - didn't expect to get jumped on
> > and thrashed about.
> 
> 
> ...



Bob,

You still don't seem to grep - I wasn't looking for assistance - merely reporting an inconsistency. AND - BTW - a CR in the text stream of a set_control_help is not incorrect (as evidenced by Kontakt's correct compilation of said "incorrectness".)

:mrgreen: :mrgreen: :mrgreen: :mrgreen: 

No sense in wither of us dragging this out any further - ya or der nein?

TS


----------



## EvilDragon (May 12, 2011)

I'm still waiting for that complete code so I can check it out over here. PM it if you don't want it to be public. We'll get to the bottom of this!


----------



## kotori (May 12, 2011)

Hi Tuwa,

thanks for the report. You are indeed right. It's a limitation in KSE and I wasn't aware of the fact that this is valid KSP syntax. It's however quite an insignificant problem since one can equally well concatenate strings or write them on a single line since a newline in the middle of a string is ignored by Kontakt. So I cannot see any reason why it would deter anyone from using KSE.

Thanks anyway for pointing it out. 

Cheers,
Nils


----------



## TuwaSni (May 12, 2011)

Big Bob @ Thu May 12 said:


> > and I wasn't aware of the fact that this is valid KSP syntax
> 
> 
> 
> ...



No problem Bob,

TS


----------

