|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。6 I% p7 ~; N! h; v& f' \7 t
语句是这样的1 F1 v% ]) N- W* V, T
is
( {$ d! B* F, N/ S/ ]7 N8 G i:integer;% A% h' O9 E# i; w5 g' e
Res:string;
8 k- e& W5 E3 ?, Y5 z. K# b, e8 h( V obj:object;
1 t) X1 ` t9 \- ?1 ?4 sdo2 N1 w3 y& ^; U, F0 K2 s& v% z7 `8 E! g
if existsObject("Status") then& {% w8 D. t3 D T+ b
Status.deleteObject;
4 X0 t1 f1 O4 m5 ~6 p* U% \* O end;
1 l N7 T2 ?2 b) z" g. ^) o# `# ] for i:=1 to 10 loop" y3 {; s* S; m2 m! D# T4 {
Res:=sprint("Store_",i);
# Z& y U: o! A% Y6 c if existsObject(Res) then6 F2 X# |9 ^* H% s+ m
Obj:=str_to_obj(Res);
0 [& ~. h, ^. I& M" N: ^ Obj.deleteObject;
, c1 A. g( H. ? M5 z {, _ end;
2 k9 a# t1 A j# ? next;
9 A8 c" P, f7 I+ K2 k --shengcheng Status:zimoxingceng: r6 z: c% V7 _; v- s6 |$ L
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
9 K3 i# F* N" y+ t3 [9 ~7 f Obj.Label:="warehouse status";- Y" Q9 L) ?# R% f( A9 h. d
$ Z0 N. ]# Z) U5 c! u1 t8 n for i:=1 to WH_nums loop3 Y# {! F6 M( \( R
Res:=sprint("Store_",i);
: h( i/ c$ s# P$ I, l6 }" h* D Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
$ M- {" @1 G( F4 `- D8 q( ] Obj.Label:=sprint("huojiaceng:",i);
2 Y& W: [) ? u Obj.xDim:=WH_x;
/ ^$ c" e) g# ] Obj.yDim:=WH_y;
! K2 {5 K% g6 v/ s# M Res:=sprint("StoreData_",i);5 S8 l: o' u6 r9 H4 C
( z0 ] k& V: H" ]" a+ _0 v
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);6 P: r' B& h7 }2 ~5 Q, O
Obj.Label:=sprint("huojiaceng:",i);
0 R- B+ U" K$ D5 p/ W Obj.inheritFormat:=false;" \1 D* t( `! B. R! u0 N$ k' n
Obj.maxxDim:=WH_x;
& G) P5 }! H* ~6 G7 O Obj.maxyDim:=WH_y;1 o M4 t; S2 C/ W. U
Obj.ColumnWidth:=3;( d- S( J* c, E# q. b9 l
next; m' V: }9 P3 y3 S7 U: j! |
6 u/ B. S6 O! t5 g, ? .Delivery.MUs.Forklift.speed:=2;
8 K5 u8 H x9 V$ V( U6 z8 y WH_var.delete({1,Part_Nums+1}..{*,*});
4 R: }- H' L( @0 e8 g6 A& q5 W for i:=1 to Part_Nums loop
3 }8 f8 t5 N; u2 n3 u' c. W3 V WH_var[1,i]:=chr(64+i);
6 K' ^/ M) j0 S1 g8 ^& [ next;
0 G2 e. a0 h. X0 J$ M5 P& S. bend;1 L+ B) p8 V6 m: q
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 % B+ U9 ~8 u" j" u
9 C, P7 F7 A k% k% M: i) I& r1 s
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|