|
我从别人那得到一个计算树木的材积程序,我想通过它转成access中的程序模块,但出现了错误,请各位好友指点哦!!!小子不胜感激。
10 D%=3
20 DIM A#(3),B#(3),C#(3),A1#(3),B1#(3)
30 DIM A2#(5,3),B2#(5,3),K%(5,3)
40 FOR I%=1 TO 3
50 READ A#(I%),B#(I%),C#(I%),A1#(I%),B1#(I%)
60 NEXT I%
70 FOR I%=1 TO 5
80 FOR J%=1 TO 3
90 READ A2#(I%,J%),B2#(I%,J%),K%(I%,J%)
100 NEXT J%
110 NEXT I%
120 DATA .000058061860,1.9558851,.89408804,.10945,.97432
130 DATA .000062341803,1.8551497,.95682492,.34879,.96410
140 DATA .000050479055,1.9085054,.99076507,.29814,.96370
150 DATA 28.3226,-645.2923,20,41.1547,-2277.2073,57,32.5420,-1152.7459,37
160 DATA 53.6998,-3389.5577,63,47.2481,-2975.1142,63,34.2245,-1331.0611,41
170 DATA 37.26899,-1136.0444,28,35.5685,-944.3192,23,37.8524,-1241.7049,31
180 DATA 37.5221,-1388.5695,35,40.0347,-1416.1801,32,46.3460,-2374.4336,51
190 DATA 33.8504,-1020.9832,29,74.3141,-7420.0166,102,30.4809,-1070.7755,36
195 INPUT "树种";I%
200 INPUT "胸径";R2
210 IF R2=-1 THEN END
230 M1#=A1#(I%)+B1#(I%)*R2
240 M2#=A2#(D%,I%)+B2#(D%,I%)/(M1#+K%(D%,I%))
260 V#=A#(I%)*M1#^B#(I%)*M2#^C#(I%)
270 PRINT USING "##.###";V#
280 GOTO 195
290 NEXT I%
上为GWBASIC程序,
以下是我在access中写的模块:
Function treev()
Dim K As Integer
Dim A(2) As String, B(2) As String, C(2) As String, A1(2) As String, B1(2) As String
Dim A2(0 To 4, 0 To 2) As String, B2(0 To 4, 0 To 2) As String, K2(0 To 4, 0 To 2) As String
<FONT size=3><FONT face="Times New R |
|