IF FILE("myfile.chk") lnTemp = FOPEN("myfile.chk") IF lnTemp < 0 ** If here, another instance has this file locked, so the ** application is already running ELSE ** If here, no other instance is running, so store the file ** handle for later use PUBLIC gnHandle gnHandle = lnTemp ENDIF ELSE ** No other instance is running PUBLIC gnHandle gnHandle = FCREATE("myfile.chk") ENDIF