Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Need state lookup routine for VFP6.0
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.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement