Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to code this
Message
From
29/04/2002 17:15:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to code this
Miscellaneous
Thread ID:
00650620
Message ID:
00650620
Views:
50
Hello all

I'm stuck with this Dbase to vfp conversion,could any one tell me how to how to code this in VFP.


aaZipToCo = new ZipToCounty()

replace Cnty with val(left( aaZipToCo[Zip1],2 )),;
CntyName with substr( aaZipToCo[Zip1],4,11 ) ,;
CityCd with iif(Cnty>=70 .and. Cnty<=74 ,1,0 ) ,;
Region with iif(CityCd=1 .or.str(Cnty,2,0)$'28-47-55',1,0) ;
for aaZipToCo.IsKey(Zip1)

release aaZipToCo

*------------------
Class ZipToCounty of AssocArray

protect Co,RP,LP,L

* L=List (a literal array) LP=List Proc RP=Range Proc

this[space(5)]='00_None'
this['00000' ]='00_None'
this['99999' ]='00_None'


this.Co='01_Albany'
this.RP(12045,12047)
this.RP(12053,12055)
this.RP(12201,12212)
this.RP(12222,12250)
this.RP(12255,12257)
this.L={ 12007,12009,12023,12041,12059,12067,12077,12084,12085,12107,;
12110,12120,12128,12143,12147,12158,12159,12161,12163,12183,;
12186,12189,12193,12214,12220,12252,12260,12288,12303,12469}
this.LP()

*-------------------------------------------------------------------*
procedure RP(RB,RE)
local N
for N=RB to RE
this[str(N,5)]=this.Co
endfor
return

procedure LP
local N
for N=1 to this.L.Size
this[str(this.L[N],5)]=this.Co
endfor
return

EndClass



Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform