Difference between revisions of "Miscellaneous TD tips"

From Team Developer SqlWindows Wiki
Jump to: navigation, search
(New page: This page covers miscellaneous TeamDeveloper tips. __TOC__ <br> <h2 style="margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;colo...)
 
Line 1: Line 1:
This page covers miscellaneous TeamDeveloper tips.
+
'''This page covers miscellaneous TeamDeveloper tips.'''
  
 
__TOC__
 
__TOC__
 
<br>
 
<br>
  
<h2 style="margin:0;background-color:#ddcef2;font-size:120%;font-weight:bold;border:1px solid #afa3bf;text-align:left;color:#000;padding:0.2em 0.4em;">[[Image:Pointer.png]]How to get the application runtime folder</h2>
+
<!------------------------------------------------------------------------------------------------------------------------------>
 +
{{TipHeader|How to get the application runtime folder}}
 
To determine from where the application was started, use the following function :<br>
 
To determine from where the application was started, use the following function :<br>
 
<pre>
 
<pre>

Revision as of 21:15, 24 September 2008

This page covers miscellaneous TeamDeveloper tips.

Contents


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
   Returns
      String:
   Local variables
      String: sDir
      String: sDummy
      String: sDrive
      String: sFolder
   Actions
      ! 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.