|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
, e2 ^" i% R A# ]( l7 ^) S) k4 W语句是这样的
" T! u$ j0 M* O" y; {/ f n& kis1 M3 d0 [8 |& y
i:integer;
" v$ ^- O8 C8 Z Res:string;- O. w6 C& o4 R2 m3 \! m" g+ i" Q
obj:object;+ j9 R. f! @7 f6 z' @1 @- Y; Z
do
( N5 l) ], r9 Q# Z3 C if existsObject("Status") then
3 K5 c! v$ q0 P. R& ]; v Status.deleteObject;
) Q% U2 l& D( Z) \: N' b2 w, h! H end;
$ B* B- t! A: J: [5 m& G for i:=1 to 10 loop* i7 k$ a6 L% i8 K R2 G
Res:=sprint("Store_",i);( |# t( S7 _, v. v
if existsObject(Res) then
4 B5 G& ]: l: N Obj:=str_to_obj(Res);
) Q7 t+ l* @+ k+ I( X8 ?: g( V b5 ~ Obj.deleteObject;, P0 o- ^6 W- W* ]
end;* I/ p" K( {: F2 N- |. k
next;- ?( a8 d' e- b. _8 X
--shengcheng Status:zimoxingceng4 V9 x& O& l; T8 ?: n, e
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");# d# M) e2 `! p& E7 ?5 Z
Obj.Label:="warehouse status";
( h3 {; u; z# }+ s) ] . } p+ `% f' e9 l
for i:=1 to WH_nums loop
. @# w1 h6 y/ h3 s) F Res:=sprint("Store_",i);
! m3 D9 K3 ` t. `5 k7 c& N Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
' r' M2 q* |1 R/ v6 ~- a Obj.Label:=sprint("huojiaceng:",i);
/ t% ?& T. g A) {" b Obj.xDim:=WH_x;3 c2 P9 d3 d- |$ k `" ]$ n
Obj.yDim:=WH_y;
8 ] h; c8 N3 n7 G" t/ i( a Res:=sprint("StoreData_",i);' ?/ x+ u7 K, N
! [: @9 @0 f4 N0 o- c6 W1 d
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);; |4 i7 ^ K+ g: [* \9 v
Obj.Label:=sprint("huojiaceng:",i);
' g/ q5 H. Q* \. V* T& D* K Obj.inheritFormat:=false;& o# e& [! A2 b, h4 \5 i1 A- k; d
Obj.maxxDim:=WH_x;
8 l! I' `. v" x7 q; e Obj.maxyDim:=WH_y;
5 R! R* V* k; b4 H" v Obj.ColumnWidth:=3;/ q( V$ S# F0 d ?' R
next;
- n( }! c& \. k# g ! w# N9 S1 l7 Z
.Delivery.MUs.Forklift.speed:=2;
+ ~& h( W- d' h0 }$ i5 B9 N) i, D WH_var.delete({1,Part_Nums+1}..{*,*});
* I+ V0 `5 R7 ^9 D7 E- I1 }9 q for i:=1 to Part_Nums loop V l) K4 s x
WH_var[1,i]:=chr(64+i);
9 _' E, L c, ]$ f5 V next;
& ~1 U1 I( W0 yend;7 _2 A. R& W9 }5 A
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 $ g+ b& H2 ^1 c+ D; c
8 e2 _2 x7 J' T; d% D1 |+ l |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|