|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。& K5 ~' ]- J \) C& B
语句是这样的+ X9 |0 U! ~5 Q# }
is! H3 \! w ~6 E
i:integer;
1 B+ T8 g1 t+ F Res:string;) g0 t. O1 i6 |: f5 M
obj:object;
* Z* Q9 ~4 Z1 jdo
( _' R3 U8 C0 f% a if existsObject("Status") then
& |$ \9 I0 l( R, z Status.deleteObject;& T1 B) l. c m& ?2 f
end;
) {& B, s0 ]2 h for i:=1 to 10 loop
, c/ @" f6 b0 r; }1 I8 F Res:=sprint("Store_",i);* a9 I) L4 x& K7 X! F; ? _! }
if existsObject(Res) then' e1 f! v8 y5 J. D
Obj:=str_to_obj(Res);
% F3 V0 I- Y: }' v7 O/ X6 V- ~1 W( x Obj.deleteObject;
6 q! o# o1 q2 d end;; k& Z3 o9 ~ `$ x
next;1 y P" b2 O% `( }
--shengcheng Status:zimoxingceng) S* N3 K2 I u8 }
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");& J% V+ ^; `* P" a( X
Obj.Label:="warehouse status";
9 x& ^, }. O; l7 f+ f7 z
' k4 R7 m( [0 {) |' R3 k for i:=1 to WH_nums loop
2 ?9 I7 |6 g4 V) v/ j' O Res:=sprint("Store_",i); Z* j) S" G1 w% z
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);# N. `+ X6 u# G7 \7 _0 p6 n1 m
Obj.Label:=sprint("huojiaceng:",i);
) |! X7 m* g2 L7 _5 R3 }4 t Obj.xDim:=WH_x;. Z/ b/ y3 s, W
Obj.yDim:=WH_y; y& p- m7 D' F" I
Res:=sprint("StoreData_",i); G) @; \5 K- |, y4 u5 a! m' R b% e
" y. P' i1 V& h9 y
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);; A5 I1 d: i: t2 k6 B/ Y
Obj.Label:=sprint("huojiaceng:",i);; F( G7 ]. i+ b
Obj.inheritFormat:=false;3 z' }1 j% Z' T( {; J0 _9 d) [: |
Obj.maxxDim:=WH_x;/ G$ o" a6 {* j. x0 e- l7 E" h/ e
Obj.maxyDim:=WH_y;" a5 M4 f, ]2 N1 ?- J3 I4 Q8 N
Obj.ColumnWidth:=3;8 ]5 H8 V& X, |5 k6 M
next;- l* f5 n% t* w
2 }$ q" s! E- w2 y$ D+ E9 W
.Delivery.MUs.Forklift.speed:=2;
& r6 s/ _' x7 E+ z0 n) `0 }, v WH_var.delete({1,Part_Nums+1}..{*,*});
; E0 Z7 n2 t4 ^# Y" ]0 |/ [ for i:=1 to Part_Nums loop
8 _) R* D, g' \6 b/ y' x8 k WH_var[1,i]:=chr(64+i);
* H/ p9 h9 Y2 P7 u$ w next;
4 m2 _( r+ R* I0 k7 }3 E; f& Cend;
' N/ Z- l" y- |, y6 r& ] U" g0 b出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 : |. g7 c+ ? Y W; H2 Q0 l
: Q( Y' E# Y9 _1 Z* F1 J3 o
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|