Miscellaneous TD tips

From Team Developer SqlWindows Wiki
Revision as of 21:15, 24 September 2008 by DaveRabelink (Talk | contribs)

Jump to: navigation, search

This page covers miscellaneous TeamDeveloper tips.


Pointer2.png How to get the application runtime folder Pointer.png

To determine from where the application was started, use the following function :

Function: GetRuntimeDirectory
   Local variables
      String: sDir
      String: sDummy
      String: sDrive
      String: sFolder
      ! The next Vis function is from vtdos.apl
      Call VisDosSplitPath( strArgArray[0], sDrive, sDir, sDummy, sDummy )
      Set sFolder = sDrive || sDir
      ! This function will allways return the folder with an ending backslash
      If SalStrRightX( sFolder, 1 ) != "\\"
         Set sFolder = sFolder || "\\"
      Return sFolder

The function SalFileGetCurrentDirectory is not the same !
That function returns the current folder which may change during runtime (eg when changing it programatically or a SalDlgFile function is used.
The GetRuntimeDirectory described here will allways return the folder where the executable was initially started from.