Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seek not working
Message
From
04/07/2006 05:15:44
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133476
Message ID:
01133543
Views:
12
>hi all,
>I have the code below. it used to work fine but it no longer does. i had not changed the code, at least i am 99% sure that i did not. i have now added in some wait windows to find out whats happening. it is taking a car registration number and making sure that it was not used already. If i try this in a vfp command window it works, in code on the form it does not. i have checked the values that i pass in and they are all correct, ie a duplicate should be found. any help much appreciated.
>
>lclregno = UPPER(ALLTRIM(thisform.pgfpageframe1.page4.txtCma_regno.Value))
>
>SELECT 0
>SELECT NWC
>
>WAIT WINDOW "reg is_" + lclregno + "_"
>
>IF lclregno <> ""
>	
>	WAIT WINDOW "regno variable is not blank"
>	
>	SELECT NWC
>	SEEK lclregno ORDER CMA_regno
>	
>	IF EOF()
>		WAIT WINDOW "try a locate first"
>		SELECT NWC
>		LOCATE FOR lclregno = UPPER(ALLTRIM(CMA_regno))
>		IF FOUND()
>			WAIT WINDOW "locate found it"
>		ELSE
>			WAIT WINDOW "not found"
>		ENDIF
>...
>...
>
Mark,
In your form, where you test it, some conditions might be different. ie: These effect the result
set key to
set filter to
set deleted
set exact && might effect if not using a full key

Also note that:
LOCATE FOR m.lclregno = UPPER(ALLTRIM(CMA_regno))
is not the same thing as:
LOCATE FOR UPPER(ALLTRIM(CMA_regno)) = m.lcRegno
when exact is off.

PS: I suggest to use m. wherever possible to prevent other type of errors.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform