Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program Error using Array
Message
 
 
To
11/08/2003 13:16:36
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00819022
Message ID:
00819040
Views:
9
There're many ways to do that in VFP. You can use SEEK() assiming that SS_TEACHERS table has index on ss_class.
IF SEEK(THIS.VALUE, "ss_teachers", "ss_class")
  REPLACE SS_CLASS WITH SS_TEACHERS.SS_CLASS, ;
          P_TEACHER WITH SS_TEACHERS.P_TEACHER, ;
          A_TEACHER WITH SS_TEACHERS.A_TEACHER ;
            IN SS_STUDENTS
ELSE
  * Error, no class found
ENDIF
>Listed below is the code I am using.
>SELECT * FROM SS_TEACHERS INTO ARRAY ga_TEACHERS
>	gc_CLASS = THIS.VALUE   &&& Combox Value
>	gnPOS = ASCAN(ga_TEACHERS, gc_CLASS) &&&& Scan for CLASS
> 	REPLACE SS_STUDENTS->SS_CLASS WITH ga_TEACHERS(gnPOS)
>        REPLACE SS_STUDENTS->P_TEACHER WITH ga_TEACHERS(gnPOS+1)
>        REPLACE SS_STUDENTS->A_TEACHER WITH ga_TEACHERS(gnPOS+2)
>What suggestion do you suggest to fix this problem?
>
>
>Thank You In Advance
>
>
>Winfred Majors
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform