Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do form cName with cVar
Message
De
15/02/2002 16:03:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00620881
Message ID:
00620895
Vues:
10
Here is how I do it (hope it helps):

In the app's main program (the parameters are here only because I call the app passing parameters it too that then get passed to the form):
*--Main.prg  (App's main program)
PARAMETERS llautorun, llforcedbf, llforceindex, llforcepack, llpolcall, lcdefaultpath
IF PARAMETERS()=0	&& run separately outside any other app
	STORE .F. TO llautorun, llforcedbf, llforceindex, llforcepack, llpolcall
ELSE				&& called from within Policy Profiler
	STORE .T. TO llpolcall	
ENDIF
*--Do form passing the following params
DO FORM Rebuildall LINKED WITH llautorun, llforcedbf, llforceindex, llforcepack, llresult, llpolcall
*--Check for returning result from form
IF llresult
        *--My code here
ENDIF
Then in the form's init method:
*--Rebuildall.init()
PARAMETERS llautorun, llforcedbf, llforceindex, llforcepack, llresult, llpolcall
THISFORM.llautorun=llautorun
THISFORM.llforcedbf=llforcedbf
THISFORM.llforceindex=llforceindex
THISFORM.llforcepack=llforcepack
THISFORM.llresult=llresult
THISFORM.lcdefaultpath=sys(2003)
Then in the form's release method:
*rebuildall.release()
llresult=thisform.llresult
DODEFAULT()
CLEAR EVENTS
Then in the form's unload method:
*Rebuildall.unload()
RETURN llresult
>Hello everybody
>
>I need a real world exapmle of "do form cName with cVar" and how to return the var
>
>I want the same form to run with 5 diffrent vars
>gcOld_dir = local dir
>gcSer_dir = server dir
>gcReq_dir = req dir
>gcLpics = local pic dir
>gcRpics = remote pic dir
>
>all the vars are 80 charecters
>
>I want to say
>

>if empty(gcOld_dir)
> do form c_path with gcOld_dir
> if empty(gcOld_dir)
> quit
> else
> replace tbl.old with gcOld_dir
> endif
>else
> replace tbl.old with gcOld_dir
>endif
>

>
>did I explane it ok???
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform