GRID.ListTemplates |
![]() ![]() |
strTemplate = GRID.ListTemplates( BYVAL nControl AS INTEGER, BYVAL nIndex AS INTEGER, [BYVAL bIncludeFolder AS INTEGER=FALSE] ) AS STRING
Returns the Template name for the specified index. Use this function to list all the available templates. You can also use this to retrieve the name of the template folder as well as the current template by using the special constants defined (see below) as index. Note that nIndex always starts at 0.
The function will implicitly do a refresh when called with index 0 to ensure that the list is always up-to-date.
Constans defined
' Get Grid Templates CONST MG_GT_CURRENT = -1 ' Return Current Template CONST MG_GT_FOLDER = -2 ' Return Current Template Folder CONST MG_GT_REFRESH = -3 ' Refresh Templates
Example:
' Subroutine to List the available templates ' SUB ListTemplates PRINT "Template Folder: ";GRID.ListTemplates( nControl, MG_GT_FOLDER ), PRINT "Current Template: ";GRID.ListTemplates( nControl, MG_GT_CURRENT ), PRINT "Available Templates: ",
DIM s AS STRING DIM i AS INTEGER
i = 0
DO s = GRID.ListTemplates( nControl, i, TRUE ) IF s <> "" THEN PRINT FORMAT( "%-5d: %s", i + 1, s ), i = i + 1 ENDIF UNTIL s = "" END SUB
' Display a list of available templates CALL ListTemplates
END |