General information
Category:
Coding, syntax & commands
Title:
Problem with SET RELATION!
We have converted an application from FP version 2 to VFP5.0. We use SET RELATION to link two tables to display information in a listbox. When the listbox is displayed the first time everything is fine. The second time we enter this screen, the first record is read from table Functions and is used with the SEEK command to find a value in table Authority. After this SEEK has finished and table Functions is selected so that we can SKIP to the next record, the record pointer skips to the end of the Functions table and we get an "end of File encountered" error message.
SELECT Authority
GOTO TOP
SET RELATION TO
SET RELATION TO Function INTO Functions ADDITIVE
.
.
.
.
.
.
SELECT Authority
SET RELATION OFF INTO Functions
.
.
.
.
.
.
SELECT Authority
GOTO TOP
SELECT Functions
GOTO TOP
DO WHILE .NOT. EOF() .AND. i <= maxrecs
if modinst()
i = i + 1
*** codes(i) = Functions->function + ' ' + Functions->func_desc
codes(i,1) = Functions->function
codes(i,2) = Functions->func_desc
mfunction = Functions->function
SELECT Authority
If Adopt
SEEK muser + mfunction IN Authority
Else
SEEK muserid + mfunction IN Authority
Endif
*-- if an authority record exists for user then flag with "û" --*
IF FOUND() .AND. Authority->auth_flag
picked(1,i) = "û" &&CHR(251)
picked(2,i) = "û" &&CHR(251)
ENDIF
endif
SELECT Functions
SKIP
ENDDO
Regards
Mahesh
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only