Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Failing at the if condition:if seek (guser)
Message
De
06/03/2003 12:57:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00762283
Message ID:
00762293
Vues:
33
Rajender,

It's hard to say...I guess "guser" is a public variable? Maybe its value has changed (and public variables should be avoided). You can add a property to the form to hold this value. Also, when using SEEK(), it is safer to explicitely tell it what work area and index to use in the 2nd and 3rd parameters.

All of this code code can easily be replaced with one or two simple SQL-SELECT statements. Just ask if you want to do this and need help.

>Sorry, i am sending it again the same one the previous one i dint mention the problem correctly.
>Failing at the if condition:if seek (guser)
>
>the following code is a class object code which i am calling in the init event of the form it is working fine.
>
>And also i am calling in the button click event of the form there it is failing.
>
>The following code is used to fill the picklist items in the form.
>
>the problem is it is failing at the if condition
>
>if seek (guser) and in the guser the user name is valid and it is not going inside the if condition it is skipping.
>
>Could you please advice me what i can do to solve this.
>
>
>*************
>IF TYPE("acuser1") = "U" OR TYPE("acUserProj1") = "U"
>	WAIT WINDOW "Gathering user profile..." NOWAIT
>	Public ARRAY acuser1(1,2),acuserProj1(1,2)
>
>	SELECT PROJECT
>	SET ORDER TO project_no
>
>	SELECT workpkg
>	SET ORDER TO wpkg_no
>
>	SELECT userproj
>	SET ORDER TO USERID
>
>	SET RELATION TO project_no INTO PROJECT ADDITIVE
>	SET RELATION  TO workpkg_no INTO workpkg additive
>	mProject_no = "~!"
>	STORE 1 TO pCnt,wCnt
>	DIMENSION acuserProj1(pCnt,2),acuser1(wCnt,3)
>	acuserProj1(1,1) = ""
>	acuserProj1(1,2) = "(None)"
>	acuser1(1,1) = ""
>	acuser1(1,2) = "(None)"
>	acuser1(1,3) = "none"
>	set step on
>	IF SEEK(gUser)
>		SCAN WHILE USERID = gUser FOR workpkg.rec_type=strtype
>			IF project_no <> mProject_no
>				mProject_no = project_no
>				pCnt = pCnt + 1
>				DIMENSION acuserProj1(pCnt,2)
>				acuserProj1(pCnt,1) = project_no
>				acuserProj1(pCnt,2) = PROJECT.pjct_name
>			ENDIF
>			wCnt = wCnt + 1
>			DIMENSION acuser1(wCnt,3)
>			acuser1(wCnt,1) = workpkg_no
>			acuser1(wCnt,2) = workpkg.wp_descrip
>			acUser1(wCnt,3) = project_no
>		ENDSCAN
>	ENDIF
>WAIT CLEAR
>elapsed = seconds() - start
>ENDIF
Steve Gibson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform