GRID.LoadFile

Previous  Next

 

state = GRID.LoadFile( BYVAL nControl AS INTEGER,

                       BYVAL filename AS STRING,

                       BYVAL options  AS INTEGER = 0 ) AS INTEGER

 

state = GRID.LoadFile( BYVAL nControl AS INTEGER,

                       BYVAL C3DFid   AS HANDLE,

                       BYVAL options  AS INTEGER = 0 ) AS INTEGER

 

 

 

 

Loads a file into the Grid using current template.  The file can be a C3D file or an ASCII file.  If the ASCII file is a MaxMATE formatted file then loadfile will import automatically.  You can also load a previously opened C3D file by supplying the C3D File ID returned from a call to C3D_open

 

The following constants have been defined in MyBASIC2_MaxGRIDX.BIS

 

' LoadFile Option Flags

CONST MG_OPT_None          = 0x00000000   ' No Options

CONST MG_OPT_Save_File     = 0x00000001   ' Return status from FireSaveFile

CONST MG_OPT_Template      = 0x00000001   ' Use Template

CONST MG_OPT_Keep_Open     = 0x00000002   ' Keep C3D File open

CONST MG_OPT_Use_Wizard    = 0x00000004   ' Use Import Wizard

CONST MG_OPT_Use_EnvVar    = 0x00000010   ' Use MyBASIC2 Environment

 

Example:

 

GRID.LoadFile( nControl, "e:\walk8.c3d" )

IF GRID.FileLoad( nControl ) THEN

  ' Hilite 1st Frame

  GRID.GoToRow( nControl, 1 )

ENDIF

 

' Do the same with an opened file

fid = C3D.OPEN( "e:\kalle.c3d" )

GRID.LoadFile( nControl, fid )

IF GRID.FileLoaded( nControl ) THEN

  ' Hilite 1st Frame

  GRID.GoToRow( nControl, 1 )

ENDIF