|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。2 y3 B+ \' l$ C
语句是这样的
, X/ c( Z$ }& Gis
- v- D4 ^9 U1 {2 l6 _: T i:integer;
+ n A2 L3 R3 T- ?) N Res:string;, j& @ K) N B5 `( g8 _9 u: u
obj:object;
( f) |8 t4 K+ z, W/ a. ado
! p, h3 d9 r9 [% M7 W* ^ if existsObject("Status") then+ @0 v8 }" s' G( Y8 B0 N/ v
Status.deleteObject;
# h$ @/ d) Y8 q% K$ I3 Z& ] end;
1 K" x. c7 p, L3 a for i:=1 to 10 loop" o6 t1 V! i0 L/ f/ X( o
Res:=sprint("Store_",i);
f# {% d1 t$ ? if existsObject(Res) then
/ s- v7 D& ~6 }7 S# p, B" h8 H; H Obj:=str_to_obj(Res);, o. j. Q n {' ^. n+ d' V- Y; Z
Obj.deleteObject;0 x+ i3 t3 Q# ?- ]/ e @+ c
end;
! M1 E% }* `# b9 K( ? next;* C8 L, H) O% V0 J. j" `
--shengcheng Status:zimoxingceng% v' v/ _' ]9 E! v- o
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
7 \* o& x" O0 |" j" ?# }1 ~ Obj.Label:="warehouse status";/ {, f" V( c$ u4 e) g
% \" R* `4 s/ o for i:=1 to WH_nums loop
& h5 g" k+ x6 }& i" {; [8 O Res:=sprint("Store_",i);" j5 ^' y6 s: m7 t0 H' o
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);! @# `/ `+ b4 y# w0 f; b
Obj.Label:=sprint("huojiaceng:",i);
0 u. B7 J* L* W7 A Obj.xDim:=WH_x;" Z$ X6 g4 g" c+ T! Q' l
Obj.yDim:=WH_y;
. ~ w0 Y/ w9 b+ f" Z; `6 Q Res:=sprint("StoreData_",i);7 M" w9 I& J+ e: s$ i. n% K) l
; G- Y' K) h# ?6 H# i6 ]
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
6 c0 u! B( g" o; j* O Obj.Label:=sprint("huojiaceng:",i);
, N( d# O/ @6 T5 Q/ c h4 g Obj.inheritFormat:=false;! d/ i- T1 c% C M
Obj.maxxDim:=WH_x;- t# G& {# w7 |( n. s
Obj.maxyDim:=WH_y;
# l( x8 E% m& n0 [ e+ E+ _ Obj.ColumnWidth:=3;/ ~1 d; R. x1 t: l# x) ?2 G5 B+ m
next;
6 {" k5 C6 r& j; j7 X
# S" V8 F% H- X+ {1 n0 `, y .Delivery.MUs.Forklift.speed:=2;1 j8 s5 Z& Q% ?) S5 @! {' |5 V5 d
WH_var.delete({1,Part_Nums+1}..{*,*});
$ W+ z: i5 N8 N" a; `% e. \ for i:=1 to Part_Nums loop* M7 Q Y: t% g5 H7 x1 {. X8 b
WH_var[1,i]:=chr(64+i);1 X. k' v4 U' V/ {- n) R: h+ }; l3 z: v
next;
- O/ d u& c* u8 q* t6 n, Tend;
2 b! z4 F( o- q6 {出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 & p' t5 f @, z3 ]; e$ G
3 |* `$ J0 K4 G6 J# M
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|