FRM
v1.4.2

ddt
Script emos_ddt_lib

CompiledModule
  |
  +--emos_ddt_lib

Tsl
emos_ddt_lib.tsl

Function Summary
 String DDT_ask(in table, in param, in msg, in flag)
          A special-purpose function.
 String DDT_choose_table(in def_path, out dir, out name)
          Displays a dialog wher you can either choose the default table or display the file-browser and pick any file you want.
 String DDT_close_table(in table)
          Closes the table.
 String ddt_get_name_sep()
          Getter function for sheet separator sign.
 String DDT_open_table(in table, in mode)
          Opens the given Excel table.
 String ddt_set_excel_sheet(in excel_filename, in excel_sheetname)
          Selects the specified sheet in the given Excel table.
 String ddt_set_name_sep(in sep)
          Setter function for sheet separator sign (default: #).
 extern._int SetExcelSheet(in._string noName, in._string noName)
          Changes the active sheet in the given excel file.
 

Function Detail

ddt_set_name_sep

public String ddt_set_name_sep(in sep)
Setter function for sheet separator sign (default: #).


ddt_get_name_sep

public String ddt_get_name_sep()
Getter function for sheet separator sign.


DDT_open_table

public String DDT_open_table(in table,
                             in mode)
Opens the given Excel table. This function supports access to multiple Excel sheets by appending "#<sheet_name>" to >table< name, e.g.
		DDT_open_table( "C:\\some_dir\\table.xls#sheet1" );

Parameters:
table - (in) table name
mode - (in) (optional) DDT_MODE_READ or DDT_MODE_READWRITE [defult: DDT_MODE_READ]
Returns:
E_OK: operation successful !E_OK: operation failed

DDT_close_table

public String DDT_close_table(in table)
Closes the table. This routine now parses the table name and removes the sheet specification if present. This way we ensure that underlying ddt_close() will not fail due to multiple sheet support integrated in DDT_open_table().

Parameters:
table - (in) table name
Returns:
E_OK: operation succeeded !E_OK: operation failed

DDT_choose_table

public String DDT_choose_table(in def_path,
                               out dir,
                               out name)
Displays a dialog wher you can either choose the default table or display the file-browser and pick any file you want.

Parameters:
def_path - (in) name of the default table (full path!)
dir - (out) name of the chosen directory
name - (out) name of the chosen file
Returns:
E_OK: table chosen ( output variables filled ) E_BAD_PATH: oeration failed

DDT_ask

public String DDT_ask(in table,
                      in param,
                      in msg,
                      in flag)
A special-purpose function. It wraps around a ddt_val function by parsing the retrieved value. If the value begins with the particular substring (default: ?), then a dialog is displayed where the retrieved value may be modified before being sent to further processing.

Parameters:
table - (in) table name (full path)
param - (in) column name
msg - (in) message to be displayed in case the substring is found
flag - (in) (optional) substring that triggers the dialog [default: ?]
Returns:
value (either modified or unmodified) which is to be further processed

SetExcelSheet

public extern._int SetExcelSheet(in._string noName,
                                 in._string noName)
Changes the active sheet in the given excel file. An Excel file contains number of worksheets. Only one among them will be active. Winrunner access only this active sheet. This function uses excel automation to implement the following algorithm:
 
 				1. Create an instance of Excel application
 				2. Open the given file in the application
 				3. Iterate through each worksheet in the file
 				4. If the worksheet name matches with the given Sheetname
 					Then Set the sheet to Active
 				5. Save the excel file
 				6. Close Excel application
Usage : SetExcelSheet ( "C:\sample.xls", "Sheet2");

Returns:
-1 Couldn't Open Excel Application -2 File not found -4 UnExpected Error -3 Sheet not found

ddt_set_excel_sheet

public String ddt_set_excel_sheet(in excel_filename,
                                  in excel_sheetname)
Selects the specified sheet in the given Excel table.

Parameters:
excel_filename - (in) name/path of the Excel table
excel_sheetname - (in) name of the excel shhet to be selected
Returns:
E_OK (0) Operation succesfull E_FILE_OPEN (-10007) Cannot open file. File may already be open. E_SHARING_VIOLATION (-10041) Sharing violation (i.e. file opened by another app) E_FILE_NOT_FOUND (-10033) File not found. E_NO_EXCEL (-20661) Couldn't Open Excel Application E_NO_EXCEL_FILE (-20662) File not found or not an excel file E_NO_EXCEL_SHEET (-20663) Sheet not found E_EXCEL_ERROR (-20664) UnExpected Error other errors possible

FRM
v1.4.2