|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
R+ B$ G. g- y7 Q D2 u语句是这样的
- s/ P! J, R( ?2 L* }% Mis0 d- j5 W; t5 f0 q9 L) j+ p. X+ X2 e
i:integer;
: P" F+ j1 z/ |9 E% w& X Res:string;
3 Z2 q0 j$ b* k0 y6 R3 r obj:object;
) G6 B) H% ?) T3 ?2 i5 E# \6 I, B Zdo' s% k) I$ u- R$ `* b2 n$ q
if existsObject("Status") then+ X5 W _- F8 L- R/ G
Status.deleteObject;
# ~) n; i! H8 d! \" e9 g- [ end;& @& f8 w0 }2 N# B
for i:=1 to 10 loop
; N, b' I2 y+ J5 j) N0 j+ x Res:=sprint("Store_",i);
) x3 \% R. y1 h; X if existsObject(Res) then! A1 U. W9 z) V. H' g) W/ p9 ?
Obj:=str_to_obj(Res);
' z" i' i) t) S/ A: G" ] Obj.deleteObject;; H4 Z& }* c( n8 D, n
end;" P- Z9 D0 M- \: v% k! c
next; w, s0 q9 t" j
--shengcheng Status:zimoxingceng
. o, c$ f. R& u) j6 Z4 S( |' U; S Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
B. B* K; T5 ~- W* D Obj.Label:="warehouse status";
( @8 D5 R( ^- V, `
9 I& e! H& @* ^& C for i:=1 to WH_nums loop
: q' I( I2 n+ a" @' q5 ?+ @ Res:=sprint("Store_",i);5 s8 g, p5 h0 ^# k
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
; A% S0 @6 t% n: ~ B% w6 P4 L Obj.Label:=sprint("huojiaceng:",i);
+ I" A! c' g! ?! D% n) j8 Y5 i2 P Obj.xDim:=WH_x;. ]3 W7 F, t w q1 ?' `
Obj.yDim:=WH_y;
1 _ w' n+ U4 O1 N% a; P) v4 L Res:=sprint("StoreData_",i);- Z0 v) S5 N4 h8 R) u# _
1 S1 s2 z3 w$ K8 b* J# o e$ { Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);2 a% C/ l4 `0 E, x( [+ u8 |6 P* ^
Obj.Label:=sprint("huojiaceng:",i);
: _0 C. |3 i% ^ Obj.inheritFormat:=false;. O9 W7 w1 [3 K% C3 S3 z
Obj.maxxDim:=WH_x;& P3 C; e" O5 [7 j
Obj.maxyDim:=WH_y;2 V8 w; a/ v2 B. b! R4 g! X& `
Obj.ColumnWidth:=3;
# V B/ p" b9 [9 y/ W+ j& Q3 U/ E next;
) Z, M! X3 D. Z* X K! ~' h7 a0 L
0 W6 R( V0 k8 t/ s .Delivery.MUs.Forklift.speed:=2;
0 f* b$ D/ a) e& T( E WH_var.delete({1,Part_Nums+1}..{*,*});% p* j8 p3 Y% M) e0 ^6 q1 O
for i:=1 to Part_Nums loop
2 Y" q: R8 h/ y- ?5 r# K WH_var[1,i]:=chr(64+i);
2 i. _3 J- P7 B1 f next;! B! v! M& ?# R
end;
0 t6 Y7 I8 D5 x& p' |- o出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
/ E3 L2 l3 J/ u; t8 v% }
/ J3 @5 x/ X3 @- P+ @0 u |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|