|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。' ~) w0 H4 l" D, `- Z( l
语句是这样的
, Q( T, x( [" iis9 `0 m: R7 ]: X% @7 N
i:integer;
9 P$ s- f" ~9 `$ c! [& w. O Res:string;
& s9 Y0 G9 D+ h* M* h5 j3 }6 B obj:object;
* n; ]: Q! g. f0 D) qdo
6 ?9 H) x8 i7 g; V8 H if existsObject("Status") then6 X/ w8 m! X. t* X a, p& B
Status.deleteObject;
' h- T H" c! `2 A2 i* L: X a4 w end;- n. {/ Y9 L3 I
for i:=1 to 10 loop3 p* f+ _6 E% ~. r7 K! c1 k
Res:=sprint("Store_",i);9 D4 m+ b8 N' ~) `4 ?/ C
if existsObject(Res) then
! N8 Y. u, p$ w$ ~7 y( O5 Z Obj:=str_to_obj(Res);
6 v+ l$ M9 U# Y- V' W Obj.deleteObject;
$ P* A) f1 P3 X8 z9 f; f end;# Y, \5 l' U& R9 L' U2 E
next;
; k, |2 j0 w8 x) q+ E --shengcheng Status:zimoxingceng* U5 [# l6 a; x0 P
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
' l& x" e/ r/ j* M Obj.Label:="warehouse status";
9 K2 B+ M$ d" { & ]& v5 }3 i0 R5 S+ Q
for i:=1 to WH_nums loop
6 S" r4 ?+ z- h- _4 p5 T Res:=sprint("Store_",i);
% ^* Q# @# y. e, `2 e2 Q* } Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
+ L6 [1 w h8 l9 | n g. H. t* N Obj.Label:=sprint("huojiaceng:",i);# W8 @2 \1 v+ ~% R& a
Obj.xDim:=WH_x;3 ]+ W% K$ K5 j3 ^) [, u! n
Obj.yDim:=WH_y;1 q* v* g+ v7 ]! O0 x1 q/ o
Res:=sprint("StoreData_",i);: b$ p0 d' _* x* X
) k" q% a7 u! e# ^ Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
9 V0 |( y7 V# J. J. X Obj.Label:=sprint("huojiaceng:",i);& P. F. M6 l* x. @: t& ?
Obj.inheritFormat:=false;4 @/ E1 W& V9 A9 S& b" m3 I) V9 Q- p
Obj.maxxDim:=WH_x;6 o4 l) C$ f' \8 l, A E
Obj.maxyDim:=WH_y;. |2 g1 d. {( _. E
Obj.ColumnWidth:=3;' j1 Y, b4 _8 T4 W! P
next;/ r8 [ }0 x5 C n5 z0 \" F
# g, I2 o# x' }2 K
.Delivery.MUs.Forklift.speed:=2;
8 X( S$ \. |3 ^ WH_var.delete({1,Part_Nums+1}..{*,*});
1 A: C( h1 e; \2 Q! l" t% i for i:=1 to Part_Nums loop
! m/ O/ M0 {' Q" Q2 b& d WH_var[1,i]:=chr(64+i);3 k8 U V: s0 p9 x% a, y
next;
5 ]9 A# F2 ~9 N# y: d, mend;
9 N( ~( W3 H" P- |出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
0 w! Z$ Y( d3 r/ U$ h0 p$ S4 O" ^0 n, W9 \- L# v7 b
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|