< Gambas 
 
 
        
      back to Gambas
Does a File or Directory exist ?
Example:
PUBLIC SUB Button1_Click()
   IF Exist("/bin/bash") = TRUE THEN
        Label1.Text="OK i found Bash"
   END IF
   IF Exist("/bin/bash") = FALSE THEN
        Label1.Text="Error Bash is missing"
   END IF
END
Get system's root / home folder ?
Example :
'Created : Cijo Jose
'E-mail  : [email protected]
'Job ID  : Junior Software Engineer
PUBLIC SUB Button1_Click()
       dir_name as string 
       dir_name = system.root    ' Will return root folder 
       print dir_name
       dir_name = system.home    ' Will return home folder 
       print dir_name
END
When you click on your button your gambas program checks for Bash if Bash is found then Label1 displays "OK i found Bash" if Bash is not found then Label1 displays "Error Bash is missing"
Gambas.SteveStarr - 02 Aug 2005
    This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.