|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
7 R5 ?: ]" v) `8 D4 Q. c6 x- Q语句是这样的3 |: ? [; m S/ ?
is! Q! w0 e9 L1 g8 s' s8 R
i:integer;
m6 _; B# I) d i) }% L0 O* Q& { Res:string;" R7 P. W# v3 @( j1 Q9 J4 H3 d( K
obj:object;
3 j/ Z1 D2 D5 K- m- Xdo
7 S3 B# @6 N- h$ p9 \8 c, m if existsObject("Status") then2 c( Y# k' \, b5 C! u! y! R3 k
Status.deleteObject;8 k4 ^+ o# _- x2 ~. B) b
end;
. j5 _% q( r _3 j8 F. ]# c. U" ^ for i:=1 to 10 loop& m+ O% i5 f. Q+ N; l
Res:=sprint("Store_",i);. `& g2 ]5 b4 `# r4 [' V
if existsObject(Res) then
+ V6 F; a! m; l5 u# e6 M Obj:=str_to_obj(Res);+ r! J: h/ L3 |6 r% L
Obj.deleteObject;
5 @8 C8 [$ W9 r end;* S3 I. a+ }0 e; Z( E }; Y+ U
next;3 X" y, ?3 g! T% p/ ]$ \' p
--shengcheng Status:zimoxingceng
3 R: q" u! ]+ P5 j4 b! z5 A6 A Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
! i( a6 E' d* g& @6 p( }/ ? Obj.Label:="warehouse status";6 N3 M6 {6 x) ]. K. ~0 h9 a9 D. A
' Y3 Q& A- w! F$ N' z for i:=1 to WH_nums loop# F L) q! f |% t9 A" I# ^
Res:=sprint("Store_",i);
" j6 r. A" i% e Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);' T m% Q. D8 ^& `! J+ ?
Obj.Label:=sprint("huojiaceng:",i);
& {1 F+ b+ \5 \' k2 B( ?) L Obj.xDim:=WH_x;
7 a, U! ^' A8 C- E R, b" K0 T Obj.yDim:=WH_y;
' i( T+ w6 z9 M Res:=sprint("StoreData_",i);
" u: }1 i9 c4 y3 h2 } / U. u7 g3 W0 P6 G5 u
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);5 m8 Q; d3 ~- S( q' T& U! u2 r7 a- Q
Obj.Label:=sprint("huojiaceng:",i);
) s5 V. D/ ~& w+ G9 D" z6 \ Obj.inheritFormat:=false;
$ o& z3 ^! u2 i! Q e( G! Q8 ] Obj.maxxDim:=WH_x;" B, l) }* E0 ?& a; j! M: V8 G( {
Obj.maxyDim:=WH_y;* K- b# s! ?3 |( L3 I _. R
Obj.ColumnWidth:=3;& P f% t2 @3 O) U
next;
- h/ n8 A" `/ f7 x+ E
: V) T7 u$ P( V7 {/ X; }) E .Delivery.MUs.Forklift.speed:=2;& A: w6 d1 I) v
WH_var.delete({1,Part_Nums+1}..{*,*});
6 I+ f1 v2 `# c+ t3 f9 c for i:=1 to Part_Nums loop2 H: G! n1 B- P$ Z8 ~
WH_var[1,i]:=chr(64+i);+ J! A- l+ l0 g d- ], _
next;
+ Y1 W1 | G: X8 h. X- x4 l- Z0 ]end; d8 c0 y2 T' V) q+ ^( B
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 6 k# S% _ J' X0 s; }8 T& D& K
5 C+ o' b# q2 ]$ o
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|