|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
7 c+ a; Z! _2 |: l7 p$ u语句是这样的4 i# \% a! A$ |6 _
is
' q* _! H( s- E$ G ~/ G i:integer;
5 c' i: N t2 g3 }2 \% h! R2 o7 k2 M X Res:string;6 c6 r* Y" D: z- O: L" O( D' Q( k$ K# a
obj:object;% g4 s+ a/ f0 J, {1 w0 W& S
do: ?, B l9 V" i- N8 g9 V! d
if existsObject("Status") then5 K" d* M7 ]# j! F0 M2 U3 L& k8 d* `1 g7 b
Status.deleteObject;- p F. L9 L) S$ i
end;6 b" x w. X+ O+ n3 H% r
for i:=1 to 10 loop6 E: N% ?/ Q/ Q
Res:=sprint("Store_",i);/ l# o/ K# r& e9 m( H# z( i
if existsObject(Res) then
U# d, o) G. h Obj:=str_to_obj(Res);
7 A6 V6 V% g' K- h1 T. d z+ d Obj.deleteObject;6 n! K o% L9 L. {8 f1 z
end;
, V1 N: u( i( a2 p* D0 I next;2 A3 u( M6 s% t l7 c
--shengcheng Status:zimoxingceng
! w3 J! F9 ^$ M$ a Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
% V" n* [) v8 H2 K Obj.Label:="warehouse status";
6 {$ `% x5 c& ^- _0 `3 _ . q8 e+ G" |* w9 n& M2 m: d
for i:=1 to WH_nums loop
$ R) c2 I3 F) N3 n2 c9 f1 A* n Res:=sprint("Store_",i);; ~' R0 Q" Q5 O' M2 x
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res); a) h1 m3 P4 d `
Obj.Label:=sprint("huojiaceng:",i);5 C: W( L! R4 e7 E# A4 \% ]
Obj.xDim:=WH_x;
+ o; s( Z1 D }# N Obj.yDim:=WH_y;
' u' a( _" o1 ~0 A Res:=sprint("StoreData_",i);, }7 d0 m$ L5 Z* n$ G' q5 x
; x1 n6 Y# `7 [. ] Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
3 K0 T, B2 D# i5 Y9 G' n# f Obj.Label:=sprint("huojiaceng:",i);
9 z5 Y: h, E4 ~ Obj.inheritFormat:=false;" Z1 `& Q5 F2 C
Obj.maxxDim:=WH_x;) j: ?! `' ?) G7 H. r- D% j
Obj.maxyDim:=WH_y;$ S1 d3 U6 U& c5 i3 g; N! ?8 i
Obj.ColumnWidth:=3;
' v" h, Y% ^+ B5 S% M+ \. F4 w) } next;7 Y+ d3 d/ b8 Z( ~/ z) T
% X7 z7 @: @( P) f% Y: Q, v .Delivery.MUs.Forklift.speed:=2;
& G" e: ~& [* N9 ~ WH_var.delete({1,Part_Nums+1}..{*,*});/ L/ P, R: Y: f; i
for i:=1 to Part_Nums loop$ f# J- w# _: V1 n
WH_var[1,i]:=chr(64+i);: w1 K$ ^0 f" Q0 s( p
next;
4 ^# g( U8 r. v' lend;- M6 |% g ?/ Y8 @
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
: x' G' \; o$ u i
7 U; p5 {% O" f* p |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|