<?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 Re: Column Dialog box to select and save column name for selected column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252502#M49564</link>
    <description>&lt;P&gt;To get started, use 'Help &amp;gt; Scripting Index' and search for 'Col List Box'. There are three examples.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2020 12:02:39 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2020-03-16T12:02:39Z</dc:date>
    <item>
      <title>Column Dialog box to select and save column name for selected column</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252496#M49563</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a dialog box which show all the column names available to the data. It will allow to select the required column and save column name to the variable. So, that I access that column in jsl using the name stored in the variable.&lt;/P&gt;&lt;P&gt;For Example: I have following table.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;john&lt;/TD&gt;&lt;TD&gt;Math&lt;/TD&gt;&lt;TD&gt;78&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Adam&lt;/TD&gt;&lt;TD&gt;Science&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Chris&lt;/TD&gt;&lt;TD&gt;Science&lt;/TD&gt;&lt;TD&gt;67&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run the script it will open the dialog (as shown in image) and after selection of column I want to access them using the variable name in which that ccolumn is stored. ( for eg. column(dt,score) )&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 11:14:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252496#M49563</guid>
      <dc:creator>Rajat</dc:creator>
      <dc:date>2020-03-16T11:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Column Dialog box to select and save column name for selected column</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252502#M49564</link>
      <description>&lt;P&gt;To get started, use 'Help &amp;gt; Scripting Index' and search for 'Col List Box'. There are three examples.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 12:02:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252502#M49564</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2020-03-16T12:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Column Dialog box to select and save column name for selected column</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252723#M49608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605"&gt;@ian_jmp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote the following code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dlg = Column Dialog(																	
			name = ColList( "Name", Min Col(1), Max Col( 1 ) ), 								
			subject = ColList( "Subject", Min Col(1) ),
				
			);
		
		If( dlg["Button"] == 1, 																
	
			name = dlg[ "name" ];
			subject = dlg["subject"]
						
			);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, After run, when I print the &lt;STRONG&gt;name,&lt;/STRONG&gt; it prints "&lt;STRONG&gt;:A&lt;/STRONG&gt;". It refers to the whole column but I want to get only the column name. How I can resolve the issue. Also sometime if I am working with multiple data tables it shows error can't access column&amp;nbsp;'A' because the row number (0) is not valid.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help how I can resolve this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 12:36:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252723#M49608</guid>
      <dc:creator>Rajat</dc:creator>
      <dc:date>2020-03-17T12:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Column Dialog box to select and save column name for selected column</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252778#M49622</link>
      <description>&lt;P&gt;Take a look at this slightly changed code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

// Modal dialog: Note that 'ColumnDialog()' is a variant of the deprecated 'Dialog()', so you 
// should probably look at 'NewWindow()' with the  '&amp;lt;&amp;lt; Modal' option
dlg = Column Dialog(																	
			name = ColList( "Name", Min Col(1), Max Col(1) ), 								
			subject = ColList( "Subject", Min Col(1), MaxCol(1) )
			);

// Stop if the user did not press 'OK'		
If( dlg["Button"] != 1, Beep(); Throw());

// Note that 'name' and 'subject' will both be lists - Look at the tooltip when you point to the variable																	
name = dlg[ "name" ];
subject = dlg["subject"];

// If you require column names . . .
name = Column(dt, name[1]) &amp;lt;&amp;lt; getName;
subject = Column(dt, subject[1]) &amp;lt;&amp;lt; getName;
Print(name, subject);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Mar 2020 15:55:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Dialog-box-to-select-and-save-column-name-for-selected/m-p/252778#M49622</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2020-03-17T15:55:51Z</dc:date>
    </item>
  </channel>
</rss>

