|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。. W! w# e% ]' F* \) p( ^* ]& o6 r
语句是这样的5 H3 ?; e/ E7 f$ f, Q) h& V
is: m6 S; ]0 O* G# b* l
i:integer;
) ? y9 B2 a# \ j: n Res:string;" \* S7 V. _- H/ h* B
obj:object;) b0 X5 \" ?8 U' U* y! C) {4 Y
do" Y; w0 W' `5 S" s+ O
if existsObject("Status") then& y- l2 ^; b- c
Status.deleteObject;0 D: I1 B+ b3 K
end;
" e8 Q, F$ r9 J; ~6 M: D for i:=1 to 10 loop% S+ l+ L" @6 e$ F1 ~, B
Res:=sprint("Store_",i);4 D/ C# u& r* T3 l$ K
if existsObject(Res) then |2 L" T/ l) ~8 [0 A* T
Obj:=str_to_obj(Res);
0 Z) d2 r8 N) }; e) l4 J Obj.deleteObject;! b- R0 p, t, y) T2 w) G
end;5 }9 a# X' R3 w5 C" i
next;8 R% A# ]4 i- O$ d7 T! {6 v8 S
--shengcheng Status:zimoxingceng
9 j% R1 a1 d! Y Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");+ B7 S- P8 H4 T& T8 y4 ^& B
Obj.Label:="warehouse status";
6 T" a/ l: K5 o2 o 6 R `# h8 N5 \* G; r8 r$ N1 ]
for i:=1 to WH_nums loop
. A8 u+ R# S: T- o. _8 ^ Res:=sprint("Store_",i); Z$ h8 M8 q! A7 K5 w: X) r& W
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);% X1 b0 M: \5 j% F5 Y! [) y
Obj.Label:=sprint("huojiaceng:",i);
. m& K0 T9 I3 }9 D9 b4 C) N: ] Obj.xDim:=WH_x;3 g# e% S' v% I% I
Obj.yDim:=WH_y;$ U4 O7 D- G0 _4 F- Q$ Q
Res:=sprint("StoreData_",i);3 O( A) w# s- V; t+ f5 j
$ A; h( y& Q# |) h: N
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
# `; {/ h. E+ M' g) j& W Obj.Label:=sprint("huojiaceng:",i);
3 ?. r& J( M9 d- f' I$ h Obj.inheritFormat:=false;# w% Q# r& j& ^7 O. s% ^7 b9 \" C
Obj.maxxDim:=WH_x;
; c: t8 Q$ O w6 O Obj.maxyDim:=WH_y;/ e s( j% f6 N8 J) e& M1 E
Obj.ColumnWidth:=3;2 C: v" {% m7 G- Z: j9 k* g1 Z
next;
c/ E$ b( Q% E9 a: k1 ^6 @ / ]! ^1 M: S# t0 H9 q) b3 ~- Q7 ~
.Delivery.MUs.Forklift.speed:=2;( w2 H- m9 c3 v9 a- s- n
WH_var.delete({1,Part_Nums+1}..{*,*});: o& h7 j% ~/ \+ p3 E: |
for i:=1 to Part_Nums loop
. H- I. N& p! V) H) f" D WH_var[1,i]:=chr(64+i);$ ]5 e9 r+ k+ a/ H2 k. j
next;
7 S$ a3 M" n3 H9 \; t4 b8 t5 T. Oend;9 W! j1 Q4 p. w& q; z7 F; e+ s
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 - \' ?' ? ~% Q
& Y0 p& g. C. _ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|