Facility Control

 View Only
  • 1.  New line in code

    Posted 10-27-2020 22:02

    Hiya

    How do I force a new line (retain the carriage return) in script?

    Not in string printing; just visually in the code.

    E.g. - instead of this:

    <ogscript handles="onload" id="" name="onload">ogscript.rename("MacroM1", params.getValueAsString('Macro_NameM1', 0));

    ogscript.setStyle("MacroM1", params.getValue('Colour_M1', 0));

    var choices1 = new Array();

    Look instead like this:

    <ogscript handles="onload" id="" name="onload">

    ogscript.rename("MacroM1", params.getValueAsString('Macro_NameM1', 0));

    ogscript.setStyle("MacroM1", params.getValue('Colour_M1', 0));

    var choices1 = new Array();

    Is there some formatting trick I can use just for aesthetics here? The editor automatically removes the carriage return on Apply Changes.

    Thanks!

    Paul

     



  • 2.  RE: New line in code

    Posted 10-28-2020 00:47

    There is no trick to force DashBoard to not remove the white space.   It always does it.

    My trick to get around this it to put a comment on the first line.   Then I can put as many spaces as I want before the code.

     

    <ogscript handles="onload" id="" name="onload">//load the macros

    ogscript.rename("MacroM1", params.getValueAsString('Macro_NameM1', 0));

    ogscript.setStyle("MacroM1", params.getValue('Colour_M1', 0));

    var choices1 = new Array();

     

     

    <


    #DashBoard


  • 3.  RE: New line in code

    Posted 10-28-2020 01:21

    Awesome thanks, that'll do nicely!


    #DashBoard