|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
! P% f! _$ V2 h1 h) }3 o* y语句是这样的
1 m7 Q5 b% i- }8 m: a# dis6 I) B# n+ P7 y2 f
i:integer;+ C9 Y1 e6 G! N: x( K
Res:string;- ?- v# U3 a3 ^. x, \. R2 c
obj:object;
2 t- s+ H* @* r5 H% c- s* l8 Bdo2 r% \" w5 {9 H- b& w. J* x
if existsObject("Status") then4 j2 O( Y0 K) {/ ?& u3 ^
Status.deleteObject;
/ h. W& n- _& C5 s4 Z5 U end;
& y1 `" s, s# v" [& g0 k& U for i:=1 to 10 loop2 F3 Z( y1 T6 c, L4 E: f9 w
Res:=sprint("Store_",i);0 N4 p2 |9 u4 o& C" X
if existsObject(Res) then
2 i, J' J, g5 [. k8 X Obj:=str_to_obj(Res);/ S3 s8 Y: G, ^1 q& Y
Obj.deleteObject;* W: S! i; _' N, o; E+ w
end;- i$ ?! p0 P& _0 U' _
next;0 l U7 t1 l7 [$ u3 c
--shengcheng Status:zimoxingceng. m3 p; c7 M, g2 L2 r6 ]& H
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");0 q/ v/ d" {/ U! Q6 _* H7 w! D9 ~0 ^
Obj.Label:="warehouse status";3 x0 ?" X0 a; Y
/ d) y) g% X9 G$ _" T for i:=1 to WH_nums loop
* ^% L' B. Q( |& L0 ]) q9 F Res:=sprint("Store_",i);. p& f, O. `! J! r) r+ B( B; h
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
4 I2 \: @4 N( k, g7 c Obj.Label:=sprint("huojiaceng:",i);
! \' F' a8 r9 s7 {5 ` Obj.xDim:=WH_x;* g$ [5 G& B- G+ c; E
Obj.yDim:=WH_y;
i. x. V# Q7 P* r, y Res:=sprint("StoreData_",i);
. R' R# P/ r$ v# v, ]# q- N 8 C" F0 U% \) T) O' y
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);2 g% |8 G+ e+ @/ b
Obj.Label:=sprint("huojiaceng:",i);3 P* N; d! C! K- ?
Obj.inheritFormat:=false;
) R" n& f) f: V3 B0 l3 d Obj.maxxDim:=WH_x;4 Z4 F8 n' n! g3 y5 y
Obj.maxyDim:=WH_y;8 }5 }' x7 ?) X& C
Obj.ColumnWidth:=3;
7 M, J$ @8 u, g next;
6 K" V& L: z0 K: D2 {# `; q
4 B6 i, T9 i" ^/ W! R .Delivery.MUs.Forklift.speed:=2;: @' M0 J% {4 }9 N4 r
WH_var.delete({1,Part_Nums+1}..{*,*});0 t2 }0 e- t! ^8 d+ l! h( `
for i:=1 to Part_Nums loop. W* g0 Y: f" N6 n& L* n
WH_var[1,i]:=chr(64+i);
, l) `: W1 U o; l# x. C next;
5 {, U) W. @1 i8 d* nend;$ S: t5 A& E' g0 U }9 U
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 4 \- f! J* _* |
% Q0 E* p! f4 Z4 F$ q
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|