base:CheckAPPDIR()

You can post your code snippets here for others to use and learn from
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

base:CheckAPPDIR()

Post by djrikki » Wed Apr 15, 2015 11:14 pm

This is used to check the presence of an application inside APPDIR - this is only aimed at AmigaOS 4.

If 'warn' is set to True and the application has not been found the user is warned by a dialog box - see separate thread for the base:SystemRequest() function.

If 'appquit' is set to True the application will quit if the application has not been found.

Code: Select all

Global base, applet_locale
base = {}
DimStr applet_locale[1]

applet_locale[3] = "Cannot find"
applet_locale[8] = "OK"
applet_locale[10] = "Required Application missing"

Function base:CheckAPPDIR(app$,warn,appquit)
    If Exists("APPDIR:" .. app$) = True
        Return ("APPDIR:" .. app$,True)
    Else
        If warn = True
            base:SystemRequest(applet_locale[10],applet_locale[3] .. " " .. "APPDIR:" .. app$,applet_locale[8],#REQICON_WARNING)
        EndIf
        If appquit = True
            End()
        Else
            Return (False, False)
        EndIf
    EndIf
EndFunction
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

Post Reply