Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need state lookup routine for VFP6.0
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Need state lookup routine for VFP6.0
Miscellaneous
Thread ID:
00596981
Message ID:
00596981
Views:
42
Need state lookup routine for VFP6.0
This is a routine I used in fp2.6 to verify that the 2 digit state code you put into the state field is in the states.dbf. If it's valid it does nothing. If it doesn't get a hit on the states.dbf it opens a gaStates array showing the states fullname. You can then select the state you want and press enter to select it. Does anyone have a vfp6.0 routine similiar to this?
Bill

Note: Here is the code for the fp2.6 routine.

*thisform.gotfocus()
DO stateary && procedure is at bottom of this page

*thisform.2 digit state field
*thisform.fieldvalid()
* States lookup table
if !seek (this.value,"States","cState")
lnTemp = States(Row(),Col())
this.value = gaStates(lnTemp,1)
endif

*-------
PROCEDURE stateary && Build States array
* ----------
public array gaStates[1]
select * from states order by states.cFullName into array gaStates

*states.dbf
cstate char 2
cfullname char 20

AL Alabama
AK Alaska
AZ Arizona
AR Arkansas
etc.
Next
Reply
Map
View

Click here to load this message in the networking platform