Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting a field in a thread
Message
From
14/03/2008 13:09:13
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01302201
Message ID:
01302203
Views:
9
Try REPLACE NeedDMR WITH .T. instead of NeedDMR = .T.

Assuming that you have a field named NeedDMR in EPA_Facility_info, what you are doing with NeedDMR = .T. is creating and initializing a memory variable of that name while MESSAGEBOX () is using the field (when a variable and a field have the same name, the field have precedence. To override this, prefix the memory variable with "m.")

>Ok, I think we've just been looking at this thing for so long. In a larger code, we fixed many other errors and seem to have it all working but this one line. We are simply trying to set this field to True or False once everything else has been done. However, the field (needdmr) stays false regardless of what we tell it to do.
>
>m.i = 1
>USE epa_limits
>GO TOP
>DO WHILE NOT EOF()
>USE epa_limits
>GOTO m.i
>	m.npidcomp = ALLTRIM(Npid)
>	MESSAGEBOX(m.npidcomp)
>	IF limit_type = "Scheduled"
>		USE epa_facility_info
>		LOCATE FOR ALLTRIM(npid) = m.npidcomp
>		IF FOUND()
>		needdmr = .T.
>		MESSAGEBOX(needdmr)
>		ENDIF
>	ELSE
>		needdmr = .F.
>	ENDIF
>	
>	IF EOF()
>		EXIT
>	ELSE
>		m.i = m.i + 1
>	ENDIF
>ENDDO
>
>When that messagebox(needdmr) pops up, it still says that needdmr is false (right after telling it to be true). Is my syntax incorrect there or something?
Previous
Reply
Map
View

Click here to load this message in the networking platform