February 13, 200323 yr I have a script that does the following:- Set error Capture [On] Open [Open Hidden, "Colleger Register"] if [status(currentError)=0] SetField[Register Online Status", "Online"] Else SetField[Register Online Status", "Offline"] End if The script works fine most of the time, but occasionally sets the field to "online" even when the "college register" file has not been found. In other words Status(CurrentError) is returning 0 after an error on open. Anyone any ideas?
February 13, 200323 yr Hi, Rather than looking for the positive, have you tried looking for the negative. By looking for the actual error may help you out. Error code 100 is File missing. Set error Capture [On] Open [Open Hidden, "Colleger Register"] if [status(currentError)=100] SetField[Register Online Status", "Offline"] Else SetField[Register Online Status", "Online"] End if HTH
February 13, 200323 yr You could also use the design function DatabaseNames to check for which files are open Set Field [Register Online Status, Case(PatternCount(DatabaseNames,"Colleger Register"),"Online","Offline")]
Create an account or sign in to comment