Newbies CurtWhit Posted March 23, 2007 Newbies Posted March 23, 2007 I am distributing a catalog of university courses on CD-ROM. Users can use the runtime solution on the CD to browse, search, and sort. But I also have a feature where they can add courses to a "collection" (like a shopping cart, but without any transactions). I've set up appropriate privileges for this field. This "flags" the course record. Obviously, they can't do that while running from the CD because they can't modify the "flag" field if the solution is on read-only media. So I would like to be able to detect at startup if they're on a non-writable volume (the CD). I can't figure out how. I've tried writing a random record in the open script. It gives the error that the file is not modifiable. But when I try to capture that error, it responds with code "0" - no problem. Any ideas how I can tell if the runtime is on a read-only volume so I can instruct the user to copy it to HD?
Fitch Posted March 23, 2007 Posted March 23, 2007 Maybe you're not capturing the error immediately, because Get(LastError) should return 6 (File is read-only).
Newbies CurtWhit Posted March 23, 2007 Author Newbies Posted March 23, 2007 Thanks. These are the first lines of the "open" script: Set Field [ courses_syllabi0708::MyCollection; "1" ] Commit Records/Requests [ No dialog ] Show Custom Dialog [ Title: "Error"; Message: Get ( LastError ); Buttons: “OK” ] I'm using the dialog just to see what the error code is so I can program to it. It always gives me "0" even on CD.
Fitch Posted March 28, 2007 Posted March 28, 2007 You need a Set Error Capture [On] step at the top. This will capture errors for the duration of the script. Then I would capture the error after EACH script step into a variable: Set Variable[ $error ; Get(LastError) ] Then I would fire up the debugger and the data viewer and watch $error as the script runs. (Custom dialog is fine if you don't have FM Advanced, but since you do, might as well use it.)
Recommended Posts
This topic is 6452 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now