<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Script window for adding three new columns, two columns with constant fixed values, and one column with numbers in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-window-for-adding-three-new-columns-two-columns-with/m-p/768247#M94846</link>
    <description>&lt;P&gt;Dear all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a script to add three new columns in my data table. Two columns will have fixed constant values and one will have numbers. Ideally script should open up a pop up window and ask for the constant values. Thankyou for helping me with this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;1st column heading: Process (Script should open a pop up window asking for the constant value in the process column)&lt;/P&gt;&lt;P&gt;2nd column heading: Lotslot&amp;nbsp;(Script should open a pop up window asking for the constant value in the process column)&lt;/P&gt;&lt;P&gt;3rd column heading: Dose (this column with have fixed set of numbers starting from a fixed number on first row (to be input by me by a popup) and then decreasing through the column by a value of 2 till the end of column)&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2024 10:07:12 GMT</pubDate>
    <dc:creator>haider15</dc:creator>
    <dc:date>2024-06-25T10:07:12Z</dc:date>
    <item>
      <title>Script window for adding three new columns, two columns with constant fixed values, and one column with numbers</title>
      <link>https://community.jmp.com/t5/Discussions/Script-window-for-adding-three-new-columns-two-columns-with/m-p/768247#M94846</link>
      <description>&lt;P&gt;Dear all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a script to add three new columns in my data table. Two columns will have fixed constant values and one will have numbers. Ideally script should open up a pop up window and ask for the constant values. Thankyou for helping me with this&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;1st column heading: Process (Script should open a pop up window asking for the constant value in the process column)&lt;/P&gt;&lt;P&gt;2nd column heading: Lotslot&amp;nbsp;(Script should open a pop up window asking for the constant value in the process column)&lt;/P&gt;&lt;P&gt;3rd column heading: Dose (this column with have fixed set of numbers starting from a fixed number on first row (to be input by me by a popup) and then decreasing through the column by a value of 2 till the end of column)&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 10:07:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-window-for-adding-three-new-columns-two-columns-with/m-p/768247#M94846</guid>
      <dc:creator>haider15</dc:creator>
      <dc:date>2024-06-25T10:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script window for adding three new columns, two columns with constant fixed values, and one column with numbers</title>
      <link>https://community.jmp.com/t5/Discussions/Script-window-for-adding-three-new-columns-two-columns-with/m-p/768268#M94848</link>
      <description>&lt;P&gt;Here is an example, taking the script example from the Scripting Index for New Window.&amp;nbsp; For the most part, it was just replicated 3 times with your specification changed for each entry&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=current data table();
ex = New Window( "Process",
	&amp;lt;&amp;lt;Type( "Modal Dialog" ),
	&amp;lt;&amp;lt;Return Result,
	V List Box(
		Text Box( "Enter the constant for the Process column" ),
		H List Box( myEditBox = Number Edit Box(  ) ),
		H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
	)
);

//  the Modal window must be closed before the following code runs

If(
	ex["button"] == 1 // not canceled
, dt &amp;lt;&amp;lt; New Column("Process", set each value(ex["myEditBox"])),
	Write( "CANCEL" ); // cancel button or red X was pressed
);


ex = New Window( "LotSlot",
	&amp;lt;&amp;lt;Type( "Modal Dialog" ),
	&amp;lt;&amp;lt;Return Result,
	V List Box(
		Text Box( "Enter the constant for the Lotslot column" ),
		H List Box( myEditBox = Number Edit Box( ) ),
		H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
	)
);

//  the Modal window must be closed before the following code runs

If(
	ex["button"] == 1 // not canceled
, dt &amp;lt;&amp;lt; New Column("LotSlot", set each value(ex["myEditBox"])),
	Write( "CANCEL" ); // cancel button or red X was pressed
);


ex = New Window( "Dose",
	&amp;lt;&amp;lt;Type( "Modal Dialog" ),
	&amp;lt;&amp;lt;Return Result,
	V List Box(
		Text Box( "Enter the starting number for the Dose column" ),
		H List Box( myEditBox = Number Edit Box( ) ),
		H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
	)
);

//  the Modal window must be closed before the following code runs

If(
	ex["button"] == 1 // not canceled
, dt &amp;lt;&amp;lt; New Column("Dose", set each value(ex["myEditBox"]-(Row()-1)*2)),
	Write( "CANCEL" ); // cancel button or red X was pressed
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jun 2024 11:28:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-window-for-adding-three-new-columns-two-columns-with/m-p/768268#M94848</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-06-25T11:28:22Z</dc:date>
    </item>
  </channel>
</rss>

