Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set fields problem
Message
From
26/04/2007 15:56:11
 
 
To
13/04/2007 21:34:51
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01215867
Message ID:
01220249
Views:
18
>>I have the following code sequence:
>>
>>select tblRawData
>>	
>>set filter to PermID == lcPermID and ((LoDrive + HiDrive)/2 + (LoCpool + HiCpool)/2 + ;
>>	(LoBike + HiBike)/2 + (LoBus + HiBus)/2 + (LoWalk + HiWalk)/2 + ;
>>	(LoAtHome + HiAtHome)/2 + (LoField + HiField)/2 + (LoOther + HiOther)/2) > 7
>>
>>go top
>>if ! eof()
>>	messagebox("The following records need to be checked for Mode Use over 7.")
>>	set fields to permid,Sequence, Company, LinkField, ;
>>	LoDrive, HiDrive, ;
>>	LoCpool, HiCpool, ;
>>	LoBike, HiBike, ;
>>	LoBus, HiBus, ;
>>	LoWalk, HiWalk, ;
>>	LoAtHome, HiAtHome, ;
>>	LoField, HiField, ;
>>	LoOther, HiOther, ;
>>	InDrive, LoDrive, HiDrive, ;
>>	InBike, LoBike, HiBike, ;
>>	InWalk, LoWalk, HiWalk, ;
>>	SpOther, InOther, LoOther, HiOther, ;
>>	InCpool, LoCpool, HiCpool, ;
>>	InBus, LoBus, HiBus, ;
>>	InAtHome, LoAtHome, HiAtHome, ;
>>	InField, LoField, HiField
>>	browse
>>	set fields to all
>>endif
>>
>>This produces an error on the browse to the effect that "variable permid is not found".
>>Any ideas as to what is causing this? The sequence works fine if I delete the set fields statement. permid is a character field and does exist in the table.
>
>I've generally found that Set Fields command doesn't behave as we would expect it - for one, it's additive. I really wouldn't know why would it error out or how to fix that, but... how about
>
>
if ! eof()
>	messagebox("The following records need to be checked for Mode Use over 7.")
>	browse fields permid,Sequence, Company, LinkField, ;
>	LoDrive, HiDrive, ;
>	LoCpool, HiCpool, ;
>	LoBike, HiBike, ;
>	LoBus, HiBus, ;
>	LoWalk, HiWalk, ;
>	LoAtHome, HiAtHome, ;
>	LoField, HiField, ;
>	LoOther, HiOther, ;
>	InDrive, LoDrive, HiDrive, ;
>	InBike, LoBike, HiBike, ;
>	InWalk, LoWalk, HiWalk, ;
>	SpOther, InOther, LoOther, HiOther, ;
>	InCpool, LoCpool, HiCpool, ;
>	InBus, LoBus, HiBus, ;
>	InAtHome, LoAtHome, HiAtHome, ;
>	InField, LoField, HiField
>endif
>
Great idea. Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform