Re: db_dump error

new topic     » goto parent     » topic index » view thread      » older message » newer message

check the rest of your code, since you got a type check error, my guess is
that fn is defined as a sequence and not an integer, atom or object, or some
other home-made type in which 4 is not a proper value.

~Greg

PS. You really should get in the habit of checking the return values you get
from functions such as db_open() and open()

Here is some cleaned up code:

procedure onClick_MenuPrint(integer self, integer even, sequence parms)
atom ret

    if db_open("Eye-Comp",DB_LOCK_NO) != DB_OK then
        ret = message_box("Could not find Eye-Comp.edb", "Database Error",
MB_OK)
        return    -- quit this procedure now
    end if

    fn = open("diag.dmp","w")
    if fn = -1 then
        ret = message_box("Could not open diag.dmp", "File Access Error",
MB_OK)
        return
    end if

    db_dump(fn,0)

    close(fn)
    db_close()

end procedure
setHandler({ MenuPrint, ToolPrint}, w32HClick, routine_id(
"onClick_MenuPrint" ))

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu