Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Init Event in a Form
Message
 
À
04/02/1999 16:51:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00184057
Message ID:
00184082
Vues:
26
This is my Form.Init Code

LOCAL oform1,oform1page1,oform1page2
oform1=THISFORMSET.lg1form1
oform1page1=oform1.bpage1frame1.page1
oform1page2=oform1.bpage1frame1.page2
SELECT ALLTRIM(userfname)+" "+ALLTRIM(userlname) AS username,usercode ;
FROM gcsharedpath+"usmain" ;
WHERE userstatus=2 AND usersalesperson=.T.;
INTO ARRAY arraysman ;
ORDER BY usmain.userfname,usmain.userlname
IF _TALLY>0
IF _TALLY=0
DIMENSION arraysman[1,2]
FOR lncounter1=1 TO 2
arraysman[1,lnCounter1]=""
ENDFOR
ELSE
DIMENSION arraysman[alen(arraysman,1)+1,2]
=AINS(arraysman,1)
FOR lncounter1=1 TO 2
arraysman[1,lnCounter1]=""
ENDFOR
ENDIF
IF !USED("tmpsman")
CREATE CURSOR tmpsman( username c(40), usercode N(4,0))
ENDIF
SELECT tmpsman
APPEND FROM ARRAY arraysman
RELEASE arraysman
SELECT countryname,countryabb,countryid,countrytime ;
FROM gcsharedpath+"COUNTRY" ;
ORDER BY country.countryname ;
INTO ARRAY arraycountry
IF _TALLY=0
DIMENSION arraycountry[1,4]
FOR lncounter1=1 TO 4
arraycountry[1,lnCounter1]=""
ENDFOR
ELSE
DIMENSION arraycountry[alen(arraycountry,1)+1,4]
=AINS(arraycountry,1)
FOR lncounter1=1 TO 4
arraycountry[1,lnCounter1]=""
ENDFOR
ENDIF
IF !USED("tmpcountry")
CREATE CURSOR tmpcountry( countryname c(50), countryabb c(2), countryid N(4), countrytime N(3,0))
ENDIF
SELECT tmpcountry
APPEND FROM ARRAY arraycountry
RELEASE arraycountry
SELECT clitypdesc,clitypid ;
FROM gcdatapath+"omclityp" ;
WHERE clitypactive=.T. ;
INTO ARRAY arrayclityp
IF _TALLY=0
DIMENSION arrayclityp[1,2]
FOR lncounter1=1 TO 2
arraycountry[1,lnCounter1]=""
ENDFOR
ELSE
DIMENSION arrayclityp[alen(arrayclityp,1)+1,2]
=AINS(arrayclityp,1)
FOR lncounter1=1 TO 2
arrayclityp[1,lnCounter1]=""
ENDFOR
ENDIF
IF !USED("tmpclityp")
CREATE CURSOR tmpclityp( clitypdesc c(50), clitypid c(10))
ENDIF
SELECT tmpclityp
APPEND FROM ARRAY arrayclityp
RELEASE arrayclityp
SELECT sourcedesc,sourceid ;
FROM gcsharedpath+"pusource" ;
WHERE sourceactive=.T. ;
INTO ARRAY arraysource
IF _TALLY=0
DIMENSION arraysource[1,2]
FOR lncounter1=1 TO 2
arraysource[1,lnCounter1]=""
ENDFOR
ELSE
DIMENSION arraysource[alen(arraysource,1)+1,2]
=AINS(arraysource,1)
FOR lncounter1=1 TO 2
arraysource[1,lnCounter1]=""
ENDFOR
ENDIF
IF !USED("tmpsource")
CREATE CURSOR tmpsource( supsoudesc c(50), supsouid c(10))
ENDIF
SELECT tmpsource
APPEND FROM ARRAY arraysource
RELEASE arraysource
SELECT supgendesc,supgenid ;
FROM gcdatapath+"omsupgen" ;
WHERE omsupgen.supgenactive=.T. ;
INTO ARRAY arraysupgen
IF _TALLY=0
DIMENSION arraysupgen[1,2]
FOR lncounter1=1 TO 2
arraysupgen[1,lnCounter1]=""
ENDFOR
ELSE
DIMENSION arraysupgen[alen(arraysupgen,1)+1,2]
=AINS(arraysupgen,1)
FOR lncounter1=1 TO 2
arraysupgen[1,lnCounter1]=""
ENDFOR
ENDIF
IF !USED("tmpsupgen")
CREATE CURSOR tmpsupgen( supgendesc c(50), supgenid c(10))
ENDIF
SELECT tmpsupgen
APPEND FROM ARRAY arraysupgen
RELEASE arraysupgen
IF !USED("tmpsupsou")
CREATE CURSOR tmpsupsou( supsoudesc c(50), supsouid c(10))
ENDIF
THISFORMSET.resetdefaults
ELSE
=THISFORMSET.lg1form1.msgbox1.showmessage(12)
RETURN .F.
IF TYPE("THISFORM.PARENT") = "O"
THISFORMSET.RELEASE
ELSE
THISFORM.RELEASE
ENDIF
ENDIF


>This behaviour may happen if you already set in Form.Init some custom form property to hold object reference before you issue RETURN .F. The fix is to reset all such properties to .NULL. and then fire RETURN .F.
>
>>No, I'M NOT USING THE NOSHOW CLAUSE. AND IF I GO TO THE PROJECT MANAGER AND RUN THE FORM DIRECTLY THE SAME THING HAPPENDS.
>>
>>>Are you using the NOSHOW clause in your DO FORM x call?
>>>
>>>
>>>>Is a modal form and plan to call with a do in a prg. I know that it's still in memory because if I choose the Window option in the menu, I see the name at the bottom part.
>>>>
>>>>>The form is still in memory? How did you call the form (DO FORM x, or CREATE('Form'), etc...) Is it modal or modeless?
>>>>>
>>>>>Mark
>>>>>
>>>>>
>>>>>>Thanks for your quikly answer. Return .F. works but the form is still in memory. I try thisform.release but doesn't work
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hello!
>>>>>>>Return a false from the Init event:
>>>>>>>RETURN .F.
>>>>>>>
>>>>>>>Mark
>>>>>>>
>>>>>>>>I want to know how to prevent to display a form that has a validation code in the init event. If the validation code fails, the form doesn't appear, otherwise goes thrue. I try nodefault and thisform.release but doesn't work.
Francisko Paternoster
fpater@patercorp.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform