March 23, 200718 yr Newbies 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?
March 23, 200718 yr Maybe you're not capturing the error immediately, because Get(LastError) should return 6 (File is read-only).
March 23, 200718 yr Author Newbies 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.
March 28, 200718 yr 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.)
Create an account or sign in to comment