1

Is there a automation tool which can automate the software build on Team Developer (v6.0).

I have tried with multiple automation tools to spy the table object in the application, it identifies it as Gupta ChildTable. But I am not able to retrieve the values from the row.

For example: 1. I have 10 rows in the table(grid) with 12 columns. I need to find the value "AAAAA" contained in first column and select that particular row via Automation. 2. I have 10 rows in the table(grid) with 12 columns. I need to find the value "AAAAA" contained in first column and click on particular cell in that row to input the data via Automation.

Thanks in advance.

3 Answers3

1

Use VisTblFindString . This function ( and many others ) are included into your TD code if include 'VT.apl' in your include libraries . VisTblFindString will return the Row - so then you simply set context to that row using SalTblSetContext( hWndForm, nRow ) , and then you can refer to the contents of each cell by name to return the value.

Syntax

nRow = VisTblFindString(hWndTable, nStartRow, hWndColumn, sString)

Handle: hWndTable

Number: nStartRow

Number: hWndColumn

String: sString

Description

Locates a string value within a column.

The string must match exactly, but case is ignored. Searching ends when the last row in the table is checked. A SAM_FetchRow message is sent for all rows that have not yet been fetched into the cache.

You can use the pattern matching characters understood by the function SalStrScan. The percent character (%) matches any set of characters. The underscore character ( _ ) matches any single character.

Parameters

hWndTable Table window handle.

nStartRow Row number at which to start the search.

hWndColumn Handle of column to search. Use hWndNULL to search all string columns.

sString String for which to search.

Return Value

Number: The row number if sString is found, or -1 if not found.

Example: Set nRow = VisTblFindString (twOrders, 0, colDesc, 'AAAAAA') Call SalTblSetContext( twOrders , nRow ) ( Now you can get the value of any cell in nRow by referring to the Column Name ) e.g. Set sCellValue = twOrders.colDesc or Set sCellValue = twOrders.colId etc.

Steve Leighton
  • 790
  • 5
  • 15
  • This function gives error. const string guptadllpath = @"C:\program files (x86)\gupta\team developer 7.1\VTI71.DLL"; [DllImport(guptadllpath)] extern static int VisTblFindString(IntPtr hwndTable, int lStartRow, IntPtr hwndColumn, string lpctszSearchFor); – mahen Aug 30 '18 at 06:11
  • Lets be clear. Its not the function VisTblFindString that is giving the error. It has work perfectly well for the last 28 years. If you are using it outside of TeamDeveloper, it could be the way you have imported it , or you haven't registered the dll, or you dont have a license to use it outside of TeamDeveloper . – Steve Leighton Aug 31 '18 at 02:53
1

Rows ( or anything what-so-ever in a TableWindow - even the cell borders , backgrounds , lines, row headers etc ) can be treat as an 'Item' or 'Object' by TeamDeveloper . Recommend you use MTbl - it is an invaluable set of add-on functions that make dealing with Tables a breeze. I know of no sites using TableWindows that don't use MTbl. In terms of rows , you can define any row as an Item or Object and manipulate it accordingly. See M!Tbl ( a TableWindows extention ) and specifically fcMTblItem.DefineAsRow( hWndTbl, nRow ).

BTW , you can also use MTbl to completely change the look and feel of your TableWindows , to give them a real modern look.

Steve Leighton
  • 790
  • 5
  • 15
0

Very rough napkin code, don't have TD on this computer. Not that you can copy&paste this easily anyway due to the code structure, only line by line.

tbl1 is the name of the table, col1 is the name of the column, substitute to fit your program.

Set nRow = TBL_MinRow
While SalTblFindNextRow( tbl1, nRow, 0, 0 )
   Call SalTblSetContext( tbl1, nRow )
   If tbl1.col1 = "AAAAA"
      Call SalTblSetFocusCell( tbl1, nRow, tbl1.col1, 0, -1 )
      Break

This should run through each row, check whether col1 has the chosen value, and then activates edit mode for that cell - provided the column is editable.

Nathanyel
  • 424
  • 2
  • 5
  • Thank you for the reply Nathanyel. But how do we get the row from the table. I see the spy identifies the object as the entire table, we are not able to pick the row object alone from the table. And what are the functions SalTblFindNextRow, SalTblSetContext & SalTblSetFocusCell doing? – user3498061 Apr 07 '14 at 07:23
  • @user3498061 Sorry, did not see this earlier. TD does not treat 'rows' as objects, only columns, with rows only as an Integer **index** to tables as well as columns. FindNextRow takes such an index as a parameter, and returns the index of the next row _(depending on filters indicated by parameters 3 and 4)_ and SetContext, well, sets the context on a row, so that you can read/write a 'cell' (object column, field row) Some other functions require a context as well, I think, though most SalTbl* functions that involve rows have an nRow parameter. – Nathanyel Oct 01 '14 at 06:44
  • @user3498061 SalTblSetFocusCell _"Sets the focus to the specified table window cell (row and column). SQLWindows puts the table window into edit mode and lets the user select a portion of the data in the cell."_ (from funcref.pdf which you might find online in various forms) – Nathanyel Oct 01 '14 at 06:45
  • 1
    Respectfully beg to differ. Rows ( or anything in a TableWindow - even the cell borders , backgrounds , row headers etc ) can be treat as an 'Item' or 'Object' . Recommend you use MTbl - it is an invaluable set of add-on functions that make dealing with Tables a breeze. I know of no sites using TableWindows that don't use MTbl. In terms of rows , you can define any row as an Item or Object and manipulate it accordingly. See http://www.micsto.com/Centura/MTbl/Manual/mtbl.htm and specifically fcMTblItem.DefineAsRow( hWndTbl, nRow ). – Steve Leighton Sep 03 '17 at 22:17
  • Indeed, but MTbl is not core TD :) – Nathanyel Aug 06 '18 at 11:48