vfpworkbookxlsx suggestion

0 views
Skip to first unread message

Michael Hogan

unread,
May 26, 2016, 3:50:28 PM5/26/16
to Thor, the Tool Manager for FoxPro
First - I've gotta say that this XLSX project is the cat's pajamas. I'm just using it for importing without those dastardly odbc drivers. Been looking for a solution like this for quite awhile.

I've gotta make a small suggestion. In the DESTROY() method, a try/catch is being used to avoid errors when closing a non-existent cursor. Here's what I like to do:

When I want to do this: 

TRY

USE IN c_workbooks

CATCH TO loException

ENDTRY


I do it like this:


USE IN SELECT("c_workbooks")


This way, if the cursor is not being used for some reason (like I went around and closed them after some operation) the SELECT("c_workbooks") returns a 0, and USE IN 0 doesn't do anything. I'm adding a cleanup or closetables method to do this, and will probably call that upon destroy.


HTH

Koen Piller

unread,
May 26, 2016, 6:22:16 PM5/26/16
to FoxPr...@googlegroups.com
Hi
Cursors are by default closer /destroyed when the application / exe is closed by VFP. To  destroye cursors when not in need seems  unnecessary to me.
Rgds
Koen
--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Verzonden vanaf mijn iPhone
Reply all
Reply to author
Forward
0 new messages