Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tony Vignone
  Where is Tony Vignone?
 St Augustine
 Florida - United States
 Tony Vignone
 To: rajesh kumar
  Where is rajesh kumar?
 patna
 India
 rajesh kumar
 Tags
Subject: RE: Run Time Code
Thread ID: 249159 Message ID: 249162 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Projects and Design
Date: Tuesday, December 29, 2009 7:02:36 PM         
   


> Dear Foxperts,
> Is it possible to write some line of text(Program Code) at run time in any specifyed/all method of the form or object.
>
> Any help will highly appreciated.
>
> Thanks in Advance.
> Rajesh kumar
> KSPL Patna

I would put a call to a function in a program file that you create on the fly.

Example:

LOCAL oForm AS FORM
oForm = CREATEOBJECT('TestForm')
oForm.SHOW(1)
RETURN

DEFINE CLASS TestForm AS FORM
	AUTOCENTER = .T.
	HEIGHT = 100
	WIDTH = 256
	ADD OBJECT cmdMake AS CommandButton WITH ;
		LEFT = 24, TOP = 3*24, HEIGHT = 24, WIDTH = 5*24, ;
		CAPTION = "Make Function"
	ADD OBJECT cmdOK AS CommandButton WITH ;
		LEFT = 6*24, TOP = 3*24, HEIGHT = 24, WIDTH = 3*24, ;
		CAPTION = "Do It"
	PROCEDURE INIT
		_screen.cls
	PROCEDURE cmdMake.Click
		local cpgm
		TEXT to cpgm noshow
			FUNCTION newFun
				_screen.print("Hello")
			RETURN	
		ENDTEXT 
		strtofile(cpgm,"FunLib.prg")
		set procedure to FunLib.prg
	ENDPROC
	PROCEDURE cmdOK.Click
		newFun()
	ENDPROC
ENDDEFINE


ENTIRE THREAD

Run Time Code Posted by rajesh kumar @ 12/29/2009 6:37:36 PM
RE: Run Time Code Posted by Vladimir Zografski @ 12/29/2009 6:54:18 PM
RE: Run Time Code Posted by Tony Vignone @ 12/29/2009 7:02:36 PM
RE: Run Time Code Posted by Cetin Basoz @ 12/29/2009 7:32:18 PM
RE: Run Time Code Posted by Anders Altberg @ 12/30/2009 5:12:11 PM
RE: Run Time Code Posted by rajesh kumar @ 1/2/2010 7:38:13 PM
RE: Run Time Code Posted by Stefan Wuebbe @ 1/3/2010 10:20:29 AM
RE: Run Time Code Posted by Anders Altberg @ 1/3/2010 4:19:01 PM
RE: Run Time Code Posted by rajesh kumar @ 1/7/2010 8:28:13 AM