GetBrowserTreeCurrentGridInfo

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > UserInterface >

GetBrowserTreeCurrentGridInfo

available from build: 20160609

Description

The command returns useful info from the current Grid being activated in the Browser Tree Page.

Syntax

call DBWShell("GetBrowserTreeCurrentGridInfo")

Results

The %TMP%\DBWReslt.IN temporary file contains the info about the current Grid.

@CURRENT_ROW

0: no grid has been activated or no rows available in the current grid
>0: the current row in the currently activated Grid

@GRID_NAME

the name of the previously activated tab
if @CURRENT_ROW > 0, the name of the currently activated Grid.

@PREVIOUS_GRID_NAME

the name of the activated tab
if @CURRENT_ROW > 0, the name of the previously activated Grid.

Remarks

All the grid and column names are in upper case.

Example

Sub Main()

 DBWInit(True)
 DBWShell("GetBrowserTreeCurrentGridInfo")
 currentRow = DBWResult("@CURRENT_ROW")
 If currentRow > 0 Then
  DBWShell("ActivityConsoleCleanAll")
  DBWShell("ActivityConsolePrint ===========================")
  gridName = DBWResult("@GRID_NAME")
  DBWShell("ActivityConsolePrint Current_grid=" & Replace(gridName," ","|") )
  previousGridName = DBWResult("@PREVIOUS_GRID_NAME")
  DBWShell("ActivityConsolePrint Previous_grid=" & Replace(previousGridName," ","|") )
  DBWShell("ActivityConsolePrint Current_row=" & currentRow)
  Set fs = CreateObject("Scripting.FileSystemObject")
  Set tfolder = fs.GetSpecialFolder(TemporaryFolder)
  Set a = fs.OpenTextFile( tfolder & "\" & "dbwreslt.in" , ForReading)
  Dim tokens
  Do While a.AtEndOfStream <> True
   line = a.ReadLine
   if line<>"" Then
    If Left(line,1) <> "@" then
     tokens = Split( line, "=", 2, 1)
     msg = tokens(0) & "=" & tokens(1)
     DBWShell("ActivityConsolePrint " & Replace(msg," ","|"))
    End if
   end if
  Loop
  a.Close
 End If
End Sub