cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
HubP_SDe
Level III

Application Current DataTable

Dear Community,

 

With your help, and many searches and iterations, I'm now close to wrapping-up my first JMP application.

 

I'm still struggling on few points, for which sure someone will suggest easy solutions ;):

  1. A the end of Dialog1 script, I'm opening a Data Table that was selected by the User
    • OnNext1 = Function( {},
      	file_path = FilePath << GetText();
      	If ( file_path != "",
      		//IST Text File
      		dt = Open(
      			file_path,
      			Columns(...)
      			...
      		);
      		...
      		
      		CurrentDataTable( dt );
      		Dialog2 << CreateInstance( dt );
      	)
    • But I'd never get the CurrentDataTable correctly set when reaching Dialog2
    • Can be seen after filling the File Path field and pressing "Next":
      Dialog2 Tiltle = ^APPNAME - ^TABLENAME
      shows no Table Name, or another preloaded DataTable name
    • Dialog2_CurrentDataTable.png
  2. This next issue would supposedly be fixed by the previous one:
    • A the end of Dialog2 script, I'm willing to Append all Columns starting with a given string, to the Dialog2 Col List Box.
    • It currently remains deperately empty, certainly due to issue #1
    • Plus getting following errors:
      • Send Expects Scriptable Object 22 times in access or evaluation of 'Send' , ColList1 << /*###*/Background Color( 2147483647 ) /*###*/
        Send Expects Scriptable Object 3 times in access or evaluation of 'Send' , ColList1 << /*###*/Set Data Type( "numeric" ) /*###*/
        Send Expects Scriptable Object in access or evaluation of 'Send' , ColList1 << /*###*/Get Items/*###*/
  3. Whatever happens on Dialog2, if I now press "OK", I'm getting the following error, related to calculated Custom Quantile variables used in Module "Report1":
    • Invalid matrix token.
      Line 69 Column 41: ...les( ( Percent1 /100 ), [►( Percent1 /100 ), ( Perc...
Stéphane DELACROIX
Senior Simulation & Planning Engineer
2 REPLIES 2
Craige_Hales
Super User

Re: Application Current DataTable

Keep the data table reference in a variable (dt in your example) and always use dt:col (etc) to reference a column. Don't depend on the current data table; the current data table changes when the user clicks any table, and possibly when any new window opens.

The error "Send Expects Scriptable Object" could explain itself better. @Audrey_Shull . The << operator is the send operator. The left hand side should be an object and the right hand side a message for the object to process.

myobject << message( ... );

The error means the left hand side is not an object that accepts messages (a scriptable object). "myobject" isn't what you expect. Try

show(myobject);
or
show(type(myobject));

to get some idea what is going on.

 

 

Craige
HubP_SDe
Level III

Re: Application Current DataTable

Thanks Mark,

 

  1. If you take a closer look at the end of "Dialog1" script, you'll see that I'm passing the "dt" reference to "Dialog2", which I'm then using in the code explicitly.
    • Neither this, not the CurrentDataTable command, seem to populate the "^TABLENAME" global reference in the "Dialog2" Title field.
    • I tried "^APPNAME - ^dt", but "^dt" is then displayed as a raw string
      Dialog2_TableName.PNG
    • I also tried to add "TABLENAME = dt;" in "Dialog2" "OnModuleLoad", but nothing changes in Dialog2 windows title: TABLENAME remains empty
  2. Dealing with the "scripting object" error, I suspect it is related to the ColList object of "Dialog2" apparently being null a the Table is not yet open at app launch.
    • I suppose I'll have to create the Col List Box dynamically in script to work this around.

Cheers!

Stéphane DELACROIX
Senior Simulation & Planning Engineer