Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using set talk ON when running a query...
Message
De
25/07/1999 14:01:25
Mike Yearwood
Toronto, Ontario, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00245430
Message ID:
00245874
Vues:
26
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
Fil
Voir

Click here to load this message in the networking platform