Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hidden method in PRG
Message
From
19/07/2005 14:41:36
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01033728
Message ID:
01033971
Views:
14
>Hi all, I have put a couple of routines in a prg file, and many of them share use a common subroutine. That subroutine will only be called by those routines in that same prg file. Is there a way to make that subroutine "hidden" in that prg file, similar to the hidden method of a class? TIA

Try this:
SET PROCEDURE TO 

TEXT TO programFile NOSHOW

PRIVATE hideProcedures
hideProcedures = ADDBS(SYS(2023))+PROGRAM()+'_HIDE.TMP'

SET TEXTMERGE TO (m.hideProcedures) NOSHOW OFF

\SET PROCEDURE TO (SYS(16)) ADDITIVE

* hide procedures
\PROCEDURE private1
\	ERROR 1162,PROGRAM()

SET TEXTMERGE TO

COMPILE (m.hideProcedures)
DO FORCEEXT(m.hideProcedures,'FXP')
ERASE m.hideProcedures

SET PROCEDURE TO (SYS(16)) ADDITIVE

PROCEDURE Public1
	RETURN "PUBLIC CALL "+TRANSFORM(Private1())


PROCEDURE Private1
	RETURN DATETIME()
	
ENDTEXT

STRTOFILE(programFile,"TestHidden.prg")

DO TestHidden.prg

CLEAR
ON ERROR ? MESSAGE()
? private1()
? Public1()
Previous
Reply
Map
View

Click here to load this message in the networking platform