Command Line

Data Flask provides a command line that records interface activity as Visual Basic Script (Language Reference).

The last line in the command window is active and may be edited.  Pressing Enter from the last line will cause the script to be executed.  Typing into any line other than the last line of the command window will cause that line to be copied to the last line, where editing can continue.  Pressing Enter over any line other the last line will cause the script text from that line to be first copied into the last line, and then executed.

If you paste into the command window, any end of line characters will be converted to a colon ( : ), the VBScript command separation character.


Figure 7-1: Command History.

Visibility of the command history can be controlled by choosing Tools/History from the menu.  Formula/Record Grid Modifications will turn command recording on and off. 



Context Features

Language and object name editing features that are available in the script editor are also available in the command line.  

A shorthand feature is available in the command line to help reduce typing.  From the context menu, Insert Filename... enters a filename using the system file dialog.  Insert Current Cell enters script that would return the currently selected cell's value.

Shorthand commands are expanded when the command script is executed by pressing Enter.  The command text is expanded, and string parameters are quoted.  If ? is provided as a string parameter, it is replaced by the results of a filename dialog selection.

Shorthand Command Example
? App.StatusBar = ? "hello, world"
Close App.ActiveDocument.Close close
Copy App.Utility.Clipboard = String copy grid.linkproperties.string
Cols For nCol =1 to Grid.NumCols: String: Next cols msgbox grid.columns.item(ncol).string
Cd App.DefaultFilePath = String cd c:\temp
Docs For Each doc In App.Documents: String: Next docs app.history.debug.prompt doc
New App.Documents.New new
Open App.Documents.Open String open categories
Paste Var = App.Utility.Clipboard paste app.statusbar
Rows For nRow =1 to Grid.NumRows: String: Next rows s=s & grid.cell(1,nrow)
Run App.Documents.Open String, "Basic", True, True run macro
Select App.Documents(String).Activate select invoices
Save App.ActiveDocument.Save save
SaveAs App.ActiveDocument.SaveAs String saveas temp
Use App.Documents.Use  String use ?
Quit App.Quit quit

Figure 7-2: Shorthand Commands.



Logging

The command history supports three separate log windows.  The Log and Debug windows may be written to by script as App.History.Log.Prompt "hello, log" or App.History.Debug.Prompt "hello, debug".

The Results window is frequently written to by the application, but the Log and Debug windows are reserved for customization.

 


Data Flask Copyright © 2006 Interscape Corporation