|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。' z% u* w# d6 _7 g) t" ~' X5 Q
语句是这样的
9 z6 q. W( p" K5 dis" [, n- @/ _6 m4 _) ~
i:integer;
: w/ b& \& _" H/ i# b Res:string;" _* h% @1 `/ p7 I
obj:object;
' r% R2 l' X! vdo8 A" T' W8 d1 G% c+ \
if existsObject("Status") then' e3 s9 D- p, q1 ]
Status.deleteObject;
7 A2 o4 s) v, Y1 {2 R" t" Z. D end;, p9 J: s/ o6 X& j2 Q& E" S, e
for i:=1 to 10 loop' I$ y, @- A2 V+ l. c/ @" {0 W# g
Res:=sprint("Store_",i);
$ U' r. z) T: n; Y3 v) d if existsObject(Res) then
4 }9 T' Z3 l! ~& Q6 ] Obj:=str_to_obj(Res);
# e6 m9 P% p, Y Obj.deleteObject;& U4 I2 M7 w3 @7 Y8 S, o) g2 p
end;
4 }' j* c- m! I2 O c next;$ p1 C- n/ [9 U) t h! C9 q
--shengcheng Status:zimoxingceng
8 H2 p. |" `: S) a1 i3 i1 I8 {: e Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
$ T( p2 u7 N2 r9 f Obj.Label:="warehouse status";" I$ r5 V& [% g
e1 w" a3 @) J. X: j% j' I3 S
for i:=1 to WH_nums loop
: T5 q! R, ^5 }. d$ j( z Res:=sprint("Store_",i);
- a- r8 r% e4 q2 K- C9 I Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
& ?/ j% b8 h% O( F5 C0 x' a Obj.Label:=sprint("huojiaceng:",i);
2 t' z' {) Z8 E1 m& U7 E0 `; c Obj.xDim:=WH_x;/ Y0 J' t( l2 }
Obj.yDim:=WH_y;& {# G: m4 l. {0 W* z" F
Res:=sprint("StoreData_",i);+ n, x3 d, x2 }9 y& }
3 E: U6 c0 A4 z2 I9 E5 j
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);( [$ A+ b2 W- _' _, V8 l
Obj.Label:=sprint("huojiaceng:",i);
1 V# V, i) K3 `0 o9 b$ e Obj.inheritFormat:=false;1 s6 s2 l0 y' Z) X
Obj.maxxDim:=WH_x;
- a% a/ d3 j0 T' F3 M4 V4 h, [4 e Obj.maxyDim:=WH_y;/ m9 K( }6 R! z0 Z
Obj.ColumnWidth:=3;
1 w9 T3 J2 D! w' Y- T B next;
$ b, R& P. T8 C- @
0 C4 W7 j/ C" y+ q .Delivery.MUs.Forklift.speed:=2;, M& V& c. X. K2 q
WH_var.delete({1,Part_Nums+1}..{*,*});
n* A& N( F, b for i:=1 to Part_Nums loop
& A; r/ M+ S0 G0 F4 x M WH_var[1,i]:=chr(64+i);0 d- v# I. h. o, q0 }* X- r
next;
# u0 ]) L9 j0 E- J/ hend;
0 h5 i) i; }4 t出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 3 l1 d. [& @% w7 g" _
. I9 U* L6 f" B& M9 E( W8 R7 i6 L |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|