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 13:20:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00762283
Message ID:
00762310
Vues:
15
>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

Does your gUser variable contain any trailing (or leading) spaces that may affect the SEEK()? How about case, is it in the proper case that matches the index tag? How about your SET COLLATE setting? SET EXACT? There are lot's of reasons this could fail. Use the debugger and stop at the code for the IF SEEK(gUser) and see what the value of it is, it could prove enlightening to what the problem is.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform