|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。# b( J& j/ J Q
语句是这样的2 F, e( E2 j* M- m, E6 U
is+ a0 ?! P% c5 o+ V
i:integer;
r- o7 d. j4 _ Res:string;$ |& }; w7 D& W* ~: B+ U
obj:object;1 ~8 i3 w, @- N# f5 e- o
do9 O. \" ^' H1 u, d& u/ q
if existsObject("Status") then7 Z8 F( r# z9 b+ B
Status.deleteObject;
) [ h, G& h+ h! c end;
5 a$ g* m& G4 V, Q" x9 z for i:=1 to 10 loop
, M* W! O6 d6 k$ O3 f X0 r( I Res:=sprint("Store_",i);+ r1 X. g& f$ w! S' T" F% i L
if existsObject(Res) then
6 m, O+ t% \' Z; W3 r' F Obj:=str_to_obj(Res);4 z ?5 ]- j1 z7 e. g
Obj.deleteObject;, h1 Z w, W! j; c V
end;9 y3 a' _: t9 O, O+ \2 h& J
next;
5 x" R! D( m0 k! u6 |3 N( m --shengcheng Status:zimoxingceng
3 u& h5 h. j6 y1 Q7 \ Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
3 M( Z; p' p, ]2 h+ {0 n6 U% h Obj.Label:="warehouse status";
: R' ?9 X. u- N$ A: @' a& S
% |- h. [4 f- e for i:=1 to WH_nums loop4 S! B$ c; r" D! i
Res:=sprint("Store_",i);
, F$ o! b: ]& z Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
3 s+ G* y7 V& ?9 x1 H5 D' |& f Obj.Label:=sprint("huojiaceng:",i);( D# E6 w0 x! I) \5 Z
Obj.xDim:=WH_x;
. d5 w% N! V9 C Obj.yDim:=WH_y;
$ R( i' l+ J1 V Res:=sprint("StoreData_",i);1 b T# ?0 s- s. x; U: ~
3 j7 [% q/ C T( {
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
5 X& `& F, Z) a0 y5 y Obj.Label:=sprint("huojiaceng:",i);
. S3 R/ Y- x$ z: y& l5 d Obj.inheritFormat:=false;5 H" l. A# @& j/ T+ G) f) l; ~
Obj.maxxDim:=WH_x;
0 m/ c$ l. g* ? Obj.maxyDim:=WH_y;/ _7 ]& e6 \+ ~
Obj.ColumnWidth:=3;' T" p& M4 I1 \* t
next;
: v& ~4 O" ?4 o/ n. H' e7 j0 _ ! M/ k) U9 ?# ]% Z7 o
.Delivery.MUs.Forklift.speed:=2;
7 T- q$ b% T9 D3 T" r; B WH_var.delete({1,Part_Nums+1}..{*,*});
4 J7 J/ }3 \# Y: C: [0 R( S3 c+ D for i:=1 to Part_Nums loop+ X3 X4 M* ]* Q* b
WH_var[1,i]:=chr(64+i);2 E5 k" {3 b, m) I! ~: w
next;
P+ j6 T" t; |5 o" y8 yend;$ c& ~5 _8 {) R
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
# C! J; y* l/ P2 f
/ W( @" P$ N% {" n |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|