14.03.2014 Views

Automation Reference - JMP

Automation Reference - JMP

Automation Reference - JMP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Application Object <strong>Reference</strong> for Automating <strong>JMP</strong><br />

Application Object<br />

If (My<strong>JMP</strong>.HasRunCommandErrorString) Then<br />

MsgBox (My<strong>JMP</strong>.GetRunCommandErrorString)<br />

End If<br />

GetTableHandleFromIndex(Integer Index)<br />

Returns the handle to the DataTable automation object given the index of a data table in the range from 1 to the<br />

number of data tables open within <strong>JMP</strong>.<br />

GetTableHandleFromName(Name as String)As DataTable<br />

Finds a data table based on its name, and returns a handle to the automation object of the table.<br />

GetTableNameFromIndex(Integer Index)<br />

Returns the name of the data table as a string given the index of a data table in the range from 1 to the number<br />

of data tables open within <strong>JMP</strong>.<br />

HasRunCommandErrorString() As Boolean<br />

Provides a simple way to query to see if there is error text at all, rather than checking for an empty string.<br />

See also GetRunCommandErrorString() As String.<br />

An example of the Visual Basic code to access these methods is:<br />

My<strong>JMP</strong>.RunCommand (Text1.Text)<br />

If (My<strong>JMP</strong>.HasRunCommandErrorString) Then<br />

MsgBox (My<strong>JMP</strong>.GetRunCommandErrorString)<br />

End If<br />

HonorSessionSavePref(Flag as Boolean)<br />

Under automation, session save is not performed on shutdown. <strong>Automation</strong> operations often recreate a certain<br />

state, and the session save confuses this. If session save is desired on shutdown during automation, call this<br />

method with a True parameter before calling the Quit method and then <strong>JMP</strong> will follow the session save<br />

preference setting. Passing a parameter of False tells <strong>JMP</strong> to ignore the session save for automation.<br />

InternetOpenItem(String URL, internetItemTypes openHow) As DataTable<br />

Opens a text or binary file. The options include opening a HTML file in its raw form into a text editor, opening<br />

a HTML file as text with the HTML tags stripped out, opening a binary <strong>JMP</strong> file and opening a HTML file<br />

that contains TABLE tags (TABLE, TD, TR, etc.) as a <strong>JMP</strong> data table. The second parameter determines the<br />

action. For the last two methods, a pointer to a <strong>JMP</strong> data table automation object will be returned in the<br />

method invocation is successful, otherwise a NULL will be returned. For the first two methods, a NULL is<br />

always returned.<br />

InternetOpenTextAsData(URL As String) As DataTable<br />

Opens a Text file at the specified URL into a <strong>JMP</strong> script window, and then attempts to import the text in that<br />

Window as a <strong>JMP</strong> data table. The current preferences for Text Import are used for the text import phase. If<br />

successful, the function returns a pointer to a <strong>JMP</strong> data table that can be manipulated using the DataTable<br />

automation object methods. NULL is returned if the method fails.<br />

An example of code for this is:<br />

Set DT = My<strong>JMP</strong>.InternetOpenTextAsData("www.sas.com/MyData/data.txt")<br />

Page 38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!