|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
5 y+ M+ f0 }: V" {语句是这样的
, P) N: R5 l1 f( O" sis0 l" n3 ]: j$ } W
i:integer;. m$ [! [0 L1 N
Res:string;
% H0 U& t# _$ c+ d" x obj:object;0 D& F( T( G' i5 Y; C3 ~
do
& J0 ]1 a! d6 [9 U; Y: T' A if existsObject("Status") then6 J" [- t# [1 T) \& w! K8 a$ D
Status.deleteObject;, Q& X S' [( P+ P
end;& P7 @9 U9 V+ f, e; p
for i:=1 to 10 loop! S" Z& d1 w g; @ i; Z
Res:=sprint("Store_",i);
1 ^$ l- k+ s5 o+ V/ y% x( G5 j9 [ if existsObject(Res) then
. s7 e2 s- @5 D$ Z$ ]( B, @ Obj:=str_to_obj(Res);$ p$ r- |2 G I: \7 O' ]
Obj.deleteObject;& E3 ?9 N- ?. I" F6 a
end;+ a2 W6 i5 x) y6 k6 k
next;
# P/ J3 `+ L+ I0 Q G; ^. @- @1 D --shengcheng Status:zimoxingceng, w, @! J3 e& o$ L7 {$ _% Q
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
& E' c1 V; t" [ Obj.Label:="warehouse status";
+ N) d% E* i8 E$ K3 t 1 d/ d2 o3 i2 A; U, [" R" G
for i:=1 to WH_nums loop. Y1 A. `3 E# [( K/ _, b# `
Res:=sprint("Store_",i);) L7 U6 ~7 P( o$ {+ f" r
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);/ W) t( w5 ^, k. i6 ?3 e
Obj.Label:=sprint("huojiaceng:",i);
/ U2 J1 C7 N) }8 I) ` Obj.xDim:=WH_x;+ n( o* X0 G: }2 o+ ]5 N
Obj.yDim:=WH_y;) |" z. U* t3 T& k. F5 i: S
Res:=sprint("StoreData_",i);
& ^& K! U" M2 N: h3 D" ~# I% p
A2 d# D) p# A3 x# f Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
" F; o9 s/ b" h- p Obj.Label:=sprint("huojiaceng:",i);, q0 b5 @7 g& c
Obj.inheritFormat:=false;
0 N# g$ V" }/ H5 T Obj.maxxDim:=WH_x;
$ \/ k2 N( k! n, T7 p Obj.maxyDim:=WH_y;
; V6 _4 E6 b- S+ T Obj.ColumnWidth:=3;9 j# J0 a& L7 U1 V9 F4 v0 F" ^7 D. B
next;( v6 |% {7 M- f1 M, H+ P! d
6 }) ?. q. [/ w* w3 Y. e .Delivery.MUs.Forklift.speed:=2;- L# T0 V2 b' R; |
WH_var.delete({1,Part_Nums+1}..{*,*});
4 f3 e& M+ l. a3 X9 p9 P& Q1 w( v for i:=1 to Part_Nums loop. j8 C" X( h' Z) H* Q+ |
WH_var[1,i]:=chr(64+i);
9 q A) y: ?5 w& L* n% ] next;% H; ~$ G X; @; [: D4 T
end;
" k8 j" s# F; d0 v; ?出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 5 e9 B1 S1 s8 G4 c0 N7 q
4 c7 k/ g3 w0 {! P
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|