|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。7 ^, M$ t _! h
语句是这样的
: i5 C; c! g$ _! gis% c l# R P! z# S2 J3 o
i:integer;
! K5 X- P0 }: a8 [9 P* Z Res:string;
) `+ P, L8 d& P* H obj:object; G7 c* g- M9 S- ~) E5 o
do
, U7 J* q5 S$ h if existsObject("Status") then
, ?, r# s6 f8 A1 n; i3 Q* Y Status.deleteObject;; ], U6 v1 |5 W6 ~
end;' M) z X7 l9 J6 M; g, S
for i:=1 to 10 loop
) H4 A1 x3 N1 m Res:=sprint("Store_",i);
" B% s9 }" T' ~0 f, f& Q if existsObject(Res) then. f" y7 o I$ ]0 f: z
Obj:=str_to_obj(Res);
{; U" L" g1 ^% p) g( o' F Obj.deleteObject;
' k; t( R2 t2 h+ J end;
" M4 ?$ ~" r n r next;: Q: ~6 j2 y, U; ]
--shengcheng Status:zimoxingceng( ?3 N. G3 M) R: e4 S. h' e: t
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");8 \- N& c9 _, w2 J; A; e
Obj.Label:="warehouse status";2 e! V# ] U0 x; }' ?) ?9 `& V
$ k u, f+ m+ y H. e for i:=1 to WH_nums loop
* S& l1 r4 G- f( y Res:=sprint("Store_",i);3 m8 f C9 [) u# h( l5 e0 n
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);( o" y; Q* Y7 ~
Obj.Label:=sprint("huojiaceng:",i);. F9 @ @$ w) |
Obj.xDim:=WH_x;
0 Y% M4 L- o0 Z" ?# w& {* I Obj.yDim:=WH_y;8 C% d' O2 @2 m4 c7 r. Q ]" Y- f: Y
Res:=sprint("StoreData_",i);% I+ u% m5 W$ i7 f
( |4 B& M" n: E& G7 I4 s- r Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);( K1 [7 A- ]0 F I
Obj.Label:=sprint("huojiaceng:",i);
/ E% i r. m9 d7 G. _ Obj.inheritFormat:=false;
* N) e' ], ?4 A' ?6 o H) o Obj.maxxDim:=WH_x;5 _1 |' h q& e/ Y) a. p, W
Obj.maxyDim:=WH_y;
4 t" d+ _, v: }1 q Obj.ColumnWidth:=3;/ I2 _. M, N5 w6 R
next;6 i& E& l4 l4 t3 V9 O: E9 c$ Z$ S5 I
4 y, r( b) i4 }4 i; I
.Delivery.MUs.Forklift.speed:=2;
3 |, v& f2 g" y( G, ]0 ]8 r WH_var.delete({1,Part_Nums+1}..{*,*});/ ]) z8 D5 Y/ C3 M' d, H
for i:=1 to Part_Nums loop/ r @4 }$ y0 d. ?) y" a$ b
WH_var[1,i]:=chr(64+i);' p( O, \& o1 O6 y8 i( l- K5 i; b
next;
+ \+ Y8 {" g; wend;+ Q2 ~# \7 ?1 b9 ?0 U
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
% h" N+ Y6 P# |, b( n
' H( Q/ ^- p ~9 w6 h, Q |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|