Mike Yearwood
Toronto, Ontario, Canada
I built a nice little object and even got it published as a tip in Foxpro Advisor and included as part of Visual Maxframe Professional. By using this technique, you're not adding a UDF to anything and assuming Fox/MS wrote decent code, it should be faster than anything we could write in VFP.
Here's how you use it.
local loSQLThermo
loSQLThermo = createobject("cusPushPopSQLThermo")
*
* Perform any SQL or USE any view
*
SELECT * ;
FROM SomeTable ;
WHERE SomeField=SomeValue ;
INTO SomeCursor
*
* when loSQLThermo is released, its Destroy()
* fires, releasing the hidden window, and SET
* TALK is returned to its previous state
*
release loSQLThermo
Here's the code
**************************************************
*-- Class: cuspushpopsqlthermo
*-- BaseClass: custom
*-- Push/Init() and Pop/Destroy() SET TALK and create a hidden window for SET TALK's output so that the native VFP thermometer status bar is displayed during a SQL-Select
*
DEFINE CLASS cuspushpopsqlthermo AS custom
*-- Stores the current SET TALK setting.
PROTECTED icsavesettalk
icsavesettalk = ""
*-- Holds a uniquely generated name used for the name of the hidden output window.
PROTECTED icuniquewindowname
icuniquewindowname = ""
icsubclassingpotential = "X"
Name = "cuspushpopsqlthermo"
PROCEDURE Destroy
local lcSaveSETTALK
lcSaveSETTALK = THIS.icSaveSETTALK
set talk &lcSaveSETTALK
release window (THIS.icUniqueWindowName)
ENDPROC
PROCEDURE Init
THIS.icSaveSETTALK = set("TALK")
THIS.icUniqueWindowName = SYS(2015)
DEFINE WINDOW (THIS.icUniqueWindowName) FROM -10,-10 to 0,0
set talk window (This.icUniqueWindowName)
set talk on
ENDPROC
ENDDEFINE
*
*-- EndDefine: cuspushpopsqlthermo
**************************************************
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement