What's new

SublimeKSP Updates (current version: 1.18.2)

Updates take time to make it to the Package Control. I have no control over how long it takes, unfortunately.

EDIT: The update is out now. You can upgrade it through the package control menu directly, and also, you must restart Sublime for it to take effect.
 
Last edited:
Since latest update 1.9.10 this doesn't compile:
Code:
on init
    USE_CODE_IF_NOT(TEST)
    // a comment...
    declare poo
    END_USE_CODE
    message(poo)
end on
It's because of the 3 (or more) dots in the comment. I know, easily avoided but just so happens that I had that in my code and couldn't figure out why code that compiled yesteday wouldn't compile today. Thought I should mention it in case someone else has the same problem.
 
Since latest update 1.9.10 this doesn't compile:
Code:
on init
    USE_CODE_IF_NOT(TEST)
    // a comment...
    declare poo
    END_USE_CODE
    message(poo)
end on
It's because of the 3 (or more) dots in the comment. I know, easily avoided but just so happens that I had that in my code and couldn't figure out why code that compiled yesteday wouldn't compile today. Thought I should mention it in case someone else has the same problem.

1.9.11 will be out very soon today with a fix.
 
I noticed an issue today.
If you use the "declare pers..." function and only use numbers as the variable name, then it won't compile correctly and not add the $ at make_persistent.

Code:
on init

    declare pers ui_button $5

end on


{ Compiled on Fri Jul 31 20:25:42 2020 }
on init
  declare $concat_it
  declare $concat_offset
  declare $string_it
  declare $list_it
  declare $preproc_i
  declare ui_button $5
  make_persistent(5)
end on
 
I think I might have found another one.
My parent panel assignments aren't working properly with my macros.
The compiled code only uses the ui controls name and not its ui_id as it's done in the manual.

Code:
on init

macro declare_var (#name#)
    declare $#name#
    declare $pnl_#name#
    #name# -> parent_panel := $pnl_#name#
end macro

declare_var(A)
declare_var(B)

end on


{ Compiled on Mon Aug 31 20:11:26 2020 }
on init
  declare $concat_it
  declare $concat_offset
  declare $string_it
  declare $list_it
  declare $preproc_i
  declare $A
  declare $pnl_A
  set_control_par($A,$CONTROL_PAR_PARENT_PANEL,$pnl_A)
  declare $B
  declare $pnl_B
  set_control_par($B,$CONTROL_PAR_PARENT_PANEL,$pnl_B)
end on
 
with panels, both sides need to be inside get_ui_id(panel_name)
#name# -> parent_panel := get_ui_id($pnl_#name#)
 
I might have found another bug (if this is not the right place to post bug reports please redirect me!)

One of my simple help text functions is outputting the wrong string....
When I compile it and then hover over that control in Kontakt it outputs "stereo 350"

Code:
macro view.layer.block(#side#, x, y, width, height, mouse)

    family layers

          view.layers.slider(stereo_width_#side#, "", x + $x_off * 2 + $x_off_dist, y + $y_off_top, 500000, 1000000, 500000, mouse)
    
        layers.sli_stereo_width_#side# -> HELP := "stereo width"   

    end family       
end macro
 
The proper place for bug reporting is Issues section of sKSP github :)

But your code is kinda wrong. Macro tokens always must have # around them. So: #side#, #x#, #y#, #width#, #height#, #mouse#
 
Thanks, I'll take a look at the forum there.

However I'm not having issues with my code. Everything else works fine and as intended.
In my experience the # are only required when the tokens are to be made a part of a longer string.
So layers.sli_stereo_width_#side# is neccessary but for the rest they are inserted and work just fine because they stand alone.
 
No, the main problem is that x alone is considered a variable, or worse, a shorthand for $CONTROL_PAR_POS_X. You don't want that. # is always required when you want to do a text replacement with macros. Even in standalone case, not as a part of a longer string necessarily.

So yeah, your code should be:

Code:
view.layers.slider(stereo_width_#side#, "", #x# + $x_off * 2 + $x_off_dist, #y# + $y_off_top, 500000, 1000000, 500000, #mouse#)
 
Small insignificant bug for when next updating:
list !string[] ... list
removes the colour formatting for the first list keyword.
 
Top Bottom