×
Menu
Index

3.6.1.1. ChronoApp

 
The ChronoApp object allows you to access the ChronoScan application object.
 
Methods:
 
Returns
Method
Description
String
GetVariableValue
Description:
   Returns a ChronoScan variable
 
Parameters:
   String variable - Requested variable to ChronoScan, for example "station_id"
 
You can see a complete variable list in the variables wizard window of ChronoScan.
 
Return value for the selected ChronoScan variable.
 
Short
SetUserVariable
Description:
 
   Sets the value of an existing user variable
   User variables are stored in ChronoScan configuration and can be used in any
   script. New variables can be added through "Program settings" in administration tab
   To obtain the value of an user variable, use the function
   GetVariableValue("uservariable.variablename")
 
Parameters:
 
   String variable - Variable name
   String value - Variable value
 
You can see a complete variable list in the variables wizard window of ChronoScan.
 
Return 1 if successful, 0 if the variable doesn't exist.
 
Short
CreateUserVariable
Description:
 
   Create a new user variable
   User variables are stored in ChronoScan configuration and can be used in any
   script.
 
Parameters:
 
   String variable - Variable name
   String value - Variable value
 
You can see a complete variable list in the variables wizard window of ChronoScan.
 
Return 1 if successful, 0 if an error occurs
 
String
GetGlobalVariable
Description:
 
   Global variables are stored in ChronoScan and they can be used in whatever script.
   These variables are temporary variables and they will be deleted at the end of
   your ChronoScan session.
 
Parameters:
 
   String VariableName
   String DefaultValue
 
Returns a requested global variable
 
void
SetGlobalVariable
Description:
 
   Global variables are stored in ChronoScan and can be used in whatever script.
   These variables are temporary variables and they will be deleted at the end of
   your ChronoScan session
 
Parameters:
 
   String VariableName
   String VariableValue
 
short
GlobalListAdd
Description:
 
   Adds a row in a global list.
   Global lists are stored in ChronoScan and can be used in whatever script.
   These lists are temporary lists and they will be deleted at the end of
   your ChronoScan session
 
Parameters:
 
   String ListName
   Array Values
 
Return 1 if successful, 0 if an error occurs
 
Example: 
 
dim arrValues
arrValues=Array ("str value 1", Now , 2222, 222.5, "str value 2")
Call ChronoApp.GlobalListAdd("my list", arrValues)
 
Array
GlobalListGet
Description:
 
   Returns a row for a global list
   Global lists are stored in ChronoScan and can be used in whatever script.
   These lists are temporary lists and they will be deleted at the end of
   your ChronoScan session
 
Parameters:
 
   String ListName
   long  Row number
 
Return: Array with all the columns
 
Example: 
 
numRow=0
myArray = ChronoApp.GlobalListGet("my lists", numRow)
For i = 0 To UBound(myArray)
            msg=msg & "|" & myArray(i)
Next
MsgBox msg
 
long
GlobalListSize
Description:
 
   Returns the number of rows of a global list
 
Parameters:
 
   String ListName
 
Return: rows count
 
short
GlobalListRemove
Description:
 
   Removes a row of a global list
 
Parameters:
 
   String: ListName
   Long: row number
 
Return 1 if successful, 0 if an error occurs
 
short
GlobalListClean
Description:
 
   Cleans the list, removing all records
 
Parameters:
 
   String: ListName
 
Return 1 if successful, 0 if an error occurs
 
void
AddToOutputWindow
Parameters:
 
   String value - Add the string to the ChronoScan trace window.
 
SHORT
DownloadFileInBrowser
Description:
 
   Downloads a local server file when ENT application mode
 
Parameters:
 
   String, file name
 
Return 1 if successful, 0 if an error occurs
ADO.Connection
CreateAdoDBConnection
Parameters:
 
   connectString - ADODB String connection.
   Take a look at this good article by Carlos Antollini to configure your DSN.
   usrId, optional username if you don't set it on your DSN
   usrPwd, optional password if you don't set it on your DSN.
 
 
Returns a connection to a database, ChronoScan will maintain this database open for you, don't call mydb.Close
ADO.Connection
GetChronoScanDBConnection
Parameters:
 
   String, name - Name of the database connection on the ChronoScan database
   manager.
   String, usrId, optional username if you don't set it on your DSN
   String, usrPwd, optional password if you don't set it on your DSN.
 
 
Returns a connection to a database, ChronoScan will maintain this database open for you, don't call mydb.Close
 
ChronoBatch
 
CreateBatch
Description:
 
   Create a new Batch
 
Parameters:
 
   String JobName
   String BatchName or blank to use default name
 
If batch name already exists, that will be returned.
 
Array
GetBatches
Description:
 
   Get a list of batches
 
Parameters:
 
   String jobname (optional)
 
Return 1 if successful, 0 if an error occurs
 
Example: 
 
batchesArray = ChronoApp.GetBatches("ENT_TUTORIAL")
 
For Each strBatch In batchesArray
    msgbox strBatch
Next
 
 
 
 
 
ChronoBatch
GetCurrentBatch
Description:
 
   Get currently opened Batch object
 
Parameters:
 
   None
 
Example: 
 
Set ChronoBatch = ChronoApp.GetCurrentBatch()
 
String
cmdline_GetValue
Parameters:
   String KeyName, the name of the key to be retrieved
 
Return:
   String, the value of the command line key.
 
Example:
 
ChronoScan.Exe -vbs:"testscript.vbs" -mykey:"c:\myprocdir"
 
ChronoApp.AddToOutputWindow "My process dir is " & ChronoApp.cmdline_GetValue("mykey")
 
SHORT
cmdline_HasKey
 
Parameters:
 
   String KeyName, the name of the key to be check
 
Return:
 
   short, 1 if the key exist on the command line, or 0 elsewhere.
 
SHORT
cmdline_HasVal
 
Parameters:
 
   String KeyName, the name of the key to be check
 
Return:
 
   short, 1 if the key exist and has value on the command line, or 0 elsewhere.
 
SHORT
MsgBox
Description:
 
   Shows a MsgBox compatible with web and services interfaces.
 
Parameters:
 
   String title, Message title
   String text, Message body text
   short buttons, Buttons to show (same as VBScript MsgBox function)
   short icon, Icon to show (same as VBScript MsgBox function)
 
Return:
 
   Same as VBScript MsgBox function
 
 
Ex: ChronoApp.MsgBox "Warning", "This is the message Body text", OKOnly, Exclamation
 
SHORT
MsgBoxTimeout
Description:
 
   Shows a auto close MsgBox compatible with web and services interfaces.
 
Parameters:
 
   String title, Message title
   String text, Message body text
   short buttons, Buttons to show (same as VBScript MsgBox function)
   short icon, Icon to show (same as VBScript MsgBox function)
   short seconds, number of seconds to wait for close the message
 
Return:
 
   Same as VBScript MsgBox function
 
 
Ex: ChronoApp.MsgBoxTimeout "Warning", "This is the message Body text", OKOnly, Exclamation, 5
 
SHORT
SendSmtpEmail
Description:
 
   Send an email using the glogal smtp settings
 
Parameters:
 
   String From email
   String FromName
   String To
   String CC
   String BCC
   String Subject
   String Body
   String Attachments (full path to a file, several files split by ";")
 
Return:
 
      short, 1 if success , or 0 error.
String
dlg_seloption_show
Description:
 
   Shows an option dialog to allows the user to select between different options.
 
Return:
 
   String, rowdata of the selected item
 
 
SHORT
dlg_seloption_add_column
Description:
 
   Add a column to the options dialog.
 
Parameters:
 
   String name, name of the column
   String flags, flags for the new column:
                  sz:100 (size in pixels)
                  align:Left (column align Left,Center,Right)
                  Combine flags using | (ex sz:100|align:Right)
 
Return:
 
   short, column id (1 based)
 
SHORT
dlg_seloption_add_row
Description:
 
   Add a new row to the options dialog.
 
Parameters:
 
   String rowdata, data value associated with this row, will be the return value of the
   dialog
 
Return:
 
   short, row id (1 based)
 
void
dlg_seloption_setrowtext
Description:
 
   Set row/column text
 
Parameters:
 
   short rowid, (1 based)
   short colid, (1 based)
   String text, text to show on the grid
 
void
dlg_seloption_setparam
Description:
 
Reserved for future options
 
void
Viewer_SetTumbnailsSize
Description:
 
   Change Viewer's Thumbnail's size
 
Parameters:
 
   short size, 1=title only, 2=small, 3=medium, 4=big
 
void
Indexer_SetFocus
Description:
 
   Set focus to field on Index panel
 
Parameters:
 
   String, field
 
void
Indexer_ShowField
Description:
 
   Shows a hidden field
 
Parameters:
 
   String, field (it allows several fields "field1|field2|field3")
void
Indexer_HideField
Description:
 
   Hides a shown field
 
Parameters:
 
   String, field (it allows several fields "field1|field2|field3")
void
Indexer_SelectFirstDoc
Description:
 
   Select first document on index panel
 
Parameters:
 
   short status, 3=all, 0=validated, 1=error
  
void
Indexer_SelectLastDoc
Description:
 
   Select last document on index panel
 
Parameters:
 
   short status, 3=all, 0=validated, 1=error
 
void
Indexer_SelectNextDoc
Description:
 
   Select next document on index panel
 
Parameters:
 
   short status, 3=all, 0=validated, 1=error
 
void
Indexer_SelectPrevDoc
Description:
 
   Select previous document on index panel
 
Parameters:
 
   short status, 3=all, 0=validated, 1=error
 
void
Indexer_SelectDocNum
Description:
 
   Select a specific document number on index panel
 
Parameters:
 
   long document number
 
void
Indexer_SelectNextPage
Description:
 
   Open next page on index panel
 
void
Indexer_SelectPrevPage
Description:
 
   Open previous page on index panel
void
Indexer_GotoPage
Description:
 
   Go to a page number
 
Parameters:
 
   short page number
Array
Indexer_GetSelectedRows
Description:
 
   Returns the selected rows on UI grid panel
 
Return: Array with all the row numbers
 
Example: 
 
 
myArray = ChronoApp.Indexer_GetSelectedRows()
For i = 0 To UBound(myArray)
            msg=msg & "|" & myArray(i)
Next
MsgBox msg
 
 
void
Indexer_FilterDocuments
Description:
 
   Filter the visible documents
 
Parameters:
 
   string field name
   string value
   string condition (optional, "=" default)
 
String
Indexer_GetXGridSelectedRowColValue
Description:
 
   Return the field value of a selected row on a Xgrid module
 
Parameters:
 
   short panel number
   string column name
 
Return: string field value
 
void
Indexer_HighlightZone
Description:
 
   Highligh a zone
 
Parameters:
   string coordinates, format: "x,y,sx,xy"
void
SetIndexMode
Description:
 
   Change to index window
 
void
SetCaptureMode
Description:
 
   Change to capture window
 
string
ent_GetCurrentUserVariable
Description:
 
   Get a custom user variable value for the logon user (enterprise version only)
 
Parameters:
 
   string, variable name (user variables should start with "uservar.")
 
void
ent_SetCurrentUserVariable
Description:
 
   Set a custom user variable value for the logon user (enterprise version only)
 
Parameters:
 
   string, variable name (user variables should start with "uservar.")
   string, variable value (user variables should start with "uservar.")
 
void
OpenLinkInBrowser
Since v.1.0.2.70
Description:
 
 Open a web browser new window with the specified url
 
Parameters:
 
  string: uri
 
 
SHORT
Indexer_OpenBatch
Since v.1.0.2.70
Description:
 
  Open the specified job/batch on the indexer
 
Parameters:
 
  string: jobname
  string: batchname
 
 
object <ChronoJob>
object <ChronoJob> : GetCurrentJob()
 
Description:
 
 Returns current opened job
 
Returns:
 
 
String
String: GetUserId(<string> username)
Since v.1.0.2.96
Description:
  Returns the user id of a provided user name (enterprise)
 
Params:
  username : string
 
Returns:
  user id : string
 
String
String : GetUserName(<string> userid)
Since v.1.0.2.96
Description:
  Returns the user name provided user id (enterprise)
 
Params:
  user id : string
 
Returns:
  user name : string
 
String
String : GetUserType(<string> userid)
Since v.1.0.2.96
Description:
  Returns the user type provided user id (enterprise)
 
Params:
  user id : string
 
Returns:
  user type: string
 
String
String : GetUserEmail(<string> userid)
Since v.1.0.2.96
Description:
  Returns the user type provided user id (enterprise)
 
Params:
  user id : string
 
Returns:
  user type: string