|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
! ?9 P! B5 v" ?4 g e7 v语句是这样的
* N$ H( U4 S% n* C# jis
3 [8 I, B6 z5 Z3 k% ` i:integer;
/ d) ?1 j1 [- f) p0 y, a8 a, W Res:string;$ o/ o4 ?1 R! R- q1 A2 ?9 L2 Y
obj:object;$ M& O- y V" r& C* N. O5 m0 w
do, S1 o' [# T& P5 z
if existsObject("Status") then0 v" O6 N+ k1 F) T) G) P. @9 F
Status.deleteObject;# u& h! r* [9 B: ~
end;
1 b, b& x3 ]& ~ for i:=1 to 10 loop
; K/ D; w6 N( J9 h6 h Res:=sprint("Store_",i);
1 M- A6 B6 U# S6 v if existsObject(Res) then
1 w! X" \8 V6 e0 ^ Obj:=str_to_obj(Res);5 l1 m/ a6 H1 c
Obj.deleteObject;8 ]6 I' T+ m+ P1 e# b7 }: V
end;1 k( e5 Q+ a+ w& F
next;+ v6 |0 q1 t2 d; T B" I) {
--shengcheng Status:zimoxingceng& i7 O3 A" V6 }+ R5 {
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
) X0 ^% R; P$ h9 _$ }' M Obj.Label:="warehouse status";2 t2 H* Y$ h+ v
) f' v' @( Z; o4 }9 y4 ` for i:=1 to WH_nums loop' ~0 M: u4 {" t {7 b
Res:=sprint("Store_",i);
" u9 D. {. [- i7 o8 o Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
1 J6 j' @* Q( x2 G: R* e% W Obj.Label:=sprint("huojiaceng:",i); ^( f# B4 p, O# ?2 `% D) _
Obj.xDim:=WH_x;& Z9 J, N* P: d/ V& _
Obj.yDim:=WH_y;
, z: H2 E3 \4 H8 g. Y& p# ? Res:=sprint("StoreData_",i);
, c* l, w0 U& ?' ]
2 P3 t& o/ r8 x3 X6 U Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);% v3 i, v2 Y0 r0 w
Obj.Label:=sprint("huojiaceng:",i);" y C6 _' Z) f0 E
Obj.inheritFormat:=false;5 B6 ^6 G! R( ` j/ x2 w5 }
Obj.maxxDim:=WH_x;5 h9 W+ T7 c5 w
Obj.maxyDim:=WH_y;( i' ?" y; r) p; s u) K. }( U& u
Obj.ColumnWidth:=3;% J* a% v! ^+ ~8 X! P
next;0 @# Q/ }) H/ E$ \1 x0 ^" t
1 O! A& _! y& h: o3 P- Z .Delivery.MUs.Forklift.speed:=2;
b; J& G& K" x: l2 b7 Y; I% N WH_var.delete({1,Part_Nums+1}..{*,*});
3 w3 G b! s7 Q& G7 \ for i:=1 to Part_Nums loop
2 _( c; l6 m$ h5 k9 @ WH_var[1,i]:=chr(64+i);
4 m# t# C$ O+ n6 O next;6 w* \ F2 ]9 R$ d
end;" s# U4 P" I6 U% o
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
* {. z4 \5 \6 {) G% V, T; |8 X# z( D
8 [5 b* i$ t: H1 i7 N$ ~ ? |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|