|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
5 S# J1 Q$ F0 a( }9 R语句是这样的+ J5 M# |6 e" `6 o/ t
is ^# m- ~0 m6 n$ Q
i:integer;
/ S8 U9 V! J' L s3 ]. N+ {0 v& ?5 B Res:string;7 a3 r8 b/ T( Z! @' {0 V
obj:object;2 ]& x1 B: ]( F" u
do" g. Y! c2 ~( u q6 c8 R4 h
if existsObject("Status") then
' m( J e7 [/ V6 g9 v Status.deleteObject;- J$ y7 f2 _# V! ]+ X4 [" Z
end;0 N3 l3 y9 X$ R! K% c$ k
for i:=1 to 10 loop0 P* q4 [& q+ g
Res:=sprint("Store_",i);
# |+ z N: r( r9 i0 v' n3 y if existsObject(Res) then
/ S9 H" n; M/ ]6 l, g B* K Obj:=str_to_obj(Res);
0 l/ L+ E$ F9 L1 K Obj.deleteObject;7 F( v4 |7 P( @3 J9 l" z
end;) p. v8 ^0 k0 A* I$ `2 A
next;' P% t' C! D+ ?7 Q9 l
--shengcheng Status:zimoxingceng
; S* x( S% ~8 ]2 L6 C/ a Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
/ M2 D" ]. N! @) n. t6 a9 O Obj.Label:="warehouse status";& R# ^( n, j% k' @, h
6 ?2 d; a6 T% ]- s
for i:=1 to WH_nums loop+ x! H* e( W' a- F* {/ t
Res:=sprint("Store_",i);2 g; Q- L, c8 W( A" `
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
% f9 O- V+ N5 ] }' i6 u Obj.Label:=sprint("huojiaceng:",i);
/ |- u2 B( d. { Obj.xDim:=WH_x;5 L) t$ ]) U4 X- m
Obj.yDim:=WH_y;
9 b( w1 w" a! L% X Res:=sprint("StoreData_",i);& n; ^1 |/ M4 y6 ^
7 O6 \( a/ O5 F v
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
: g+ T7 z3 F/ r6 `6 z6 P4 K Obj.Label:=sprint("huojiaceng:",i);( |5 w6 W* d4 W3 l
Obj.inheritFormat:=false;
9 n5 f; B7 _& j* a Obj.maxxDim:=WH_x; x2 [: N! e i% \. k
Obj.maxyDim:=WH_y;$ u; x7 G5 {$ b
Obj.ColumnWidth:=3;; O. ^9 X0 P5 R8 N6 ]) `
next;
1 j3 z4 u8 _; E0 ~, n2 }9 k# c ( f& b* @3 f* {
.Delivery.MUs.Forklift.speed:=2;" g' g* Y ?- ]& o& S& _+ i$ [
WH_var.delete({1,Part_Nums+1}..{*,*});
8 a, K, c' J* L for i:=1 to Part_Nums loop* e! M7 `9 q( ~" L( [' M
WH_var[1,i]:=chr(64+i);8 G+ @1 S& v6 t0 ?) P
next;
$ r9 ^, j4 }( C/ K% u) t7 |+ q( ]end;- N/ E6 }+ S4 P" {6 \
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ^' i6 @5 ?5 S' ^ R+ M6 ~, m
( t; Z. R# B4 C6 I0 ^- u' v$ c/ |
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|