|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。/ {& L, v3 t% r% w4 r5 K3 C
语句是这样的6 _3 t ]6 W3 D4 o" K+ k3 l
is0 X! `& ?8 N* Z3 a: w5 U) Z
i:integer;( r/ ^9 I" I ^+ A7 o
Res:string;* D1 P# K1 A8 O" r V' M8 ~- h+ }+ |
obj:object;3 _" P, _; R# X% ]
do2 Q5 p1 ^& _# X
if existsObject("Status") then* I& C& O7 R0 o" n; b
Status.deleteObject;' h+ Q. g+ s$ }2 P! R; Z
end;6 \! i$ L' }' g: _5 H, O
for i:=1 to 10 loop
' ]' Y6 Q! G# p! o* Y Res:=sprint("Store_",i);
- n3 y {: [) o. M* f9 @ if existsObject(Res) then
3 H! t4 L W5 D' d x/ s; m6 C Obj:=str_to_obj(Res);
Z- M" R! {! r( c+ Y% ~/ \+ y! B( {1 i7 U Obj.deleteObject;
/ i, B O5 ~" }5 |' [ end;
0 o+ t6 s3 o& M+ P4 g8 y$ y next;
4 j- \. K; o6 \) k --shengcheng Status:zimoxingceng& X8 Z% Z; }1 x- p$ u
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");# X1 S- A4 v8 K9 b' t' a4 S
Obj.Label:="warehouse status";
7 {- E! B3 a5 Y+ d" [6 @6 n. Z 0 i2 R1 c! P& G5 C
for i:=1 to WH_nums loop4 ]. ~: C- y% Y& d+ I% t7 b
Res:=sprint("Store_",i);; H8 ^6 A# h# Z
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
- w( s; g2 V! _8 w4 G* p& v4 A Obj.Label:=sprint("huojiaceng:",i);) Q1 [8 J5 F" }0 ^6 i6 _7 M
Obj.xDim:=WH_x;
: e+ ~) b; r+ s# t Obj.yDim:=WH_y;
2 t; g8 J! h1 _5 t' H# R/ u Res:=sprint("StoreData_",i);
]& _! H0 r8 e( p, v8 b' L
! x! M3 a B9 R: e* D5 P* V! p Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);. e O9 m; \% l% ?, N. B/ {
Obj.Label:=sprint("huojiaceng:",i);
, C, b T2 ?0 S6 O1 R* q Obj.inheritFormat:=false;7 W s+ ~5 a: N5 P& f
Obj.maxxDim:=WH_x;+ M3 V1 @5 o0 X; s
Obj.maxyDim:=WH_y;0 d( B/ e& J' ?: h$ C# _+ |3 U
Obj.ColumnWidth:=3;* f) E; g0 S- T9 S% V7 j, J; ~8 j
next;0 B8 C$ @. O1 S/ q
3 i* x5 Q+ g0 t2 R# i
.Delivery.MUs.Forklift.speed:=2;3 c, i, l5 _/ X3 r4 k/ {8 A- d, n2 r' m' X
WH_var.delete({1,Part_Nums+1}..{*,*});8 w; o, q0 n9 [
for i:=1 to Part_Nums loop3 h. j4 U3 k* h9 ^
WH_var[1,i]:=chr(64+i);% K# {# W! Q' @
next;
7 Q# U3 d! z/ i7 H& A7 P5 ~end;. q# y! a0 S5 f! P
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 1 d* F! m2 O6 n! P9 _' y
* h7 }. }% t' b0 @4 h |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|