Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Westminster Circle, Akron
 Ohio - United States
 Andy Kramek
 To: Thomas Bähr
  Where is Thomas Bähr?
 Leipzig
 Germany
 Thomas Bähr
 Tags
Subject: RE: PUBl Vars Pro&Contra
Thread ID: 141897 Message ID: 142116 # Views: 48 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Tuesday, August 14, 2007 8:21:41 PM         
   


>
> ***********************************************************************
> * Program....: SetPresEnv.prg
> * Author.....: Andy Kramek
> * Date.......: 02 August 2001
> * Notice.....: Copyright (c) 2001 Tightline Computers Ltd, All Rights Reserved.
> * Compiler...: Visual FoxPro 07.00.0000.9262 for Windows 
> * Purpose....: Environment Setup Program
> ***********************************************************************
> 
> RELEASE glCopySQL
> PUBLIC glCopySQL
> glCopySQL = .T.
> 

>
> + using that PUBL VAR Value somethere inside a HIDDEN CLASS ... great encapsulation there Pal!!

What makes you think this is a class definition, let alone a hidden class? This is taken out of context from an environmental setup program for a conference session given at the San Diego DevCon in 2001. This variable is used to override normal behavior and dump SQL generated in the course of demonstrations to the clipboard for showing attendees. It is merely the configuration program run to set paths, and other environmental items for a demonstration!

If you must post my code, then post ALL of it not just selected parts!
***********************************************************************
* Program....: SetPresEnv.prg
* Author.....: Andy Kramek
* Date.......: 02 August 2001
* Notice.....: Copyright (c) 2001 Tightline Computers Ltd, All Rights Reserved.
* Compiler...: Visual FoxPro 07.00.0000.9262 for Windows 
* Purpose....: Environment Setup Program
***********************************************************************
CLOSE DATABASES ALL
CLEAR
LOCAL lcPath
***************************************************
*** Start with the Path
***************************************************
*** This is Dev Mode - Full Path required 
lcPath = (HOME() + ";" ) + (FULLPATH( CURDIR() ) + ";METADATA;DATA")
SET PATH TO (lcPath)
*** We can also force Asserts on in this case
SET ASSERTS ON
*** And set the variable which makes data classes copy SQL to clipboard
RELEASE glCopySQL
PUBLIC glCopySQL
glCopySQL = .T.
***************************************************
*** Now we should be able to open the class libraries without errors
***************************************************
SET CLASSLIB TO rootclass, genforms, basectrl, presclass ADDITIVE
***************************************************
*** And the Procedure files
***************************************************
SET PROCEDURE TO dataclass, dsetbase ADDITIVE
***************************************************
*** We need to add the Data Manager and Connect to SQL Server
*** So make sure we have the _Screen property
***************************************************
IF NOT PEMSTATUS( _Screen, 'oDM', 5 )
    _Screen.AddProperty( 'oDM', NULL )
ENDIF
***************************************************
*** Add the Data Manager and Connect. Check for success
***************************************************
_Screen.oDM = CREATEOBJECT( 'xDatMgr', 'vfpdemo' )
IF VARTYPE( _Screen.oDM ) = "O"
    *** We have the Data Manager, but did it connect?
    lnCon = _Screen.oDm.GetHandle( 'VFP' )
    IF lnCon < 0
        MESSAGEBOX( 'Cannot Connect using VFPDemo', 16, 'Setup Error' )
        RETURN
    ENDIF
    *** OK, now add the SQL Connection
    _Screen.oDM.AddConnection( 'sqldemo' )
    lnCon = _Screen.oDm.GetHandle( 'SQL' )
    IF lnCon < 0
        MESSAGEBOX( 'Cannot Connect using SQLDemo', 16, 'Setup Error' )
        RETURN
    ENDIF
ELSE
    MESSAGEBOX( 'Cannot create the Data Manager', 16, 'Fatal Setup Error' )
    RETURN
ENDIF
***************************************************
*** Now run the Demo Manager
***************************************************
SET STATUS BAR OFF
DO FORM DemoMgr


This is only used so that I can demonstrate something easily in a Conference session. It is certainly not application or "production" code.

Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA

COMPLETE THREAD

PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/13/2007 12:08:05 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/13/2007 12:14:19 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/13/2007 12:57:40 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/13/2007 2:32:12 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/13/2007 3:11:49 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/13/2007 7:56:45 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 11:44:08 AM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 12:45:58 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 3:29:09 PM
RE: PUBl Vars Pro&Contra Posted by Tamar Granor @ 8/14/2007 11:01:24 PM
RE: PUBl Vars Pro&Contra Posted by Don Higgins @ 8/14/2007 6:08:45 PM
RE: PUBl Vars Pro&Contra Posted by Borislav Borissov @ 8/13/2007 8:06:04 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 11:29:35 AM
RE: PUBl Vars Pro&Contra Posted by Borislav Borissov @ 8/14/2007 11:52:47 AM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 3:32:44 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/13/2007 8:47:49 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 11:33:59 AM
RE: PUBl Vars Pro&Contra Posted by Hugo Ranea @ 8/14/2007 7:16:32 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/13/2007 9:24:07 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 1:56:56 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 3:53:24 PM
RE: PUBl Vars Pro&Contra Posted by Pamela Thalacker @ 8/14/2007 5:10:35 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 5:23:21 PM
RE: PUBl Vars Pro&Contra Posted by Pamela Thalacker @ 8/14/2007 5:50:03 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 6:33:05 PM
RE: PUBl Vars Pro&Contra Posted by Pamela Thalacker @ 8/14/2007 9:30:16 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 11:13:19 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 5:33:08 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/14/2007 5:51:13 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 9:10:42 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/14/2007 9:23:26 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 9:03:19 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 9:08:02 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 8:04:15 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 8:21:41 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 9:00:41 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 11:17:07 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/14/2007 5:42:39 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 6:36:33 PM
RE: PUBl Vars Pro&Contra Posted by Hugo Ranea @ 8/14/2007 7:28:15 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 7:57:11 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/14/2007 7:46:56 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 8:11:04 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/14/2007 8:31:23 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 8:37:53 PM
RE: PUBl Vars Pro&Contra Posted by Tamar Granor @ 8/14/2007 11:10:39 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 8:00:32 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/14/2007 9:05:56 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/14/2007 9:32:30 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/14/2007 11:40:11 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/15/2007 5:29:29 PM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/15/2007 8:36:16 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/16/2007 12:26:42 AM
RE: PUBl Vars Pro&Contra Posted by Mike Yearwood @ 8/16/2007 3:01:29 AM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/17/2007 5:12:06 PM
RE: PUBl Vars Pro&Contra Posted by Tamar Granor @ 8/14/2007 11:07:01 PM
RE: PUBl Vars Pro&Contra Posted by Tamar Granor @ 8/14/2007 10:58:35 PM
RE: PUBl Vars Pro&Contra Posted by Ilya Rabyy @ 8/15/2007 5:09:16 PM
RE: PUBl Vars Pro&Contra Posted by Vincent Byrne @ 8/14/2007 9:55:05 PM
RE: PUBl Vars Pro&Contra Posted by Andy Kramek @ 8/14/2007 11:17:48 PM
RE: PUBl Vars Pro&Contra Posted by Vincent Byrne @ 8/15/2007 8:10:06 PM
RE: PUBl Vars Pro&Contra Posted by Thomas Bähr @ 8/15/2007 10:50:53 AM