Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LOCATE
Message
From
21/08/2000 12:04:35
 
 
To
21/08/2000 11:52:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: LOCATE
Miscellaneous
Thread ID:
00407349
Message ID:
00407357
Views:
22
>help!
>what am I doing wrong here. It returns an error saying is missing a comma.
>Can I use the LOCATE here?
>
>IIF(LOCATE FOR temp.Fyr = '2002' AND temp.source '777'),temp.descr," ")

LOCATE is a command, not a function. It does not return anything.
You're missing an "=" between temp.source and '777' too.
Also, the IIF is terminated after '777' - you've got too many ")"s

Use LOCATE then FOUND() - or better yet, SEEK() on a tag.
LOCATE FOR temp.fyr = '2002' AND temp.source = '777'
lcDesc= IIF(FOUND(),temp.descr," ")
better
** need INDEX ON fyr+source TAG tagname
lcSearch = PADR("2002",FSIZE("fyr","temp"))+PADR("777",FSIZE("source","temp"))
lcDesc = IIF(SEEK(lcSearch,"temp","tagname"),temp.descr," ")
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform