|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。: J1 k0 E0 l0 `$ ?" @: V5 O3 ^
语句是这样的
/ I J9 h5 I/ I' p; wis
0 x" p/ a0 T: {5 G! p% R' I i:integer;
. \' W: ~" d/ T X; \ Res:string;) D/ i8 O2 F2 ~9 \/ q' ~
obj:object;
& o c+ Z$ q+ E( s* }/ Fdo+ Q+ n: q( C% A+ {" B. D
if existsObject("Status") then( q* a8 f' B- I+ n
Status.deleteObject;
2 Y/ K1 d C, d' g8 B0 M9 [1 K end;/ a+ Q9 H( ?2 a% Q
for i:=1 to 10 loop6 X5 G* l7 D2 K% F
Res:=sprint("Store_",i);
1 t3 \( P/ j' r: W5 L3 O1 f if existsObject(Res) then1 h# Z* g- ^2 X* d; _2 e
Obj:=str_to_obj(Res);
' r9 b9 H+ Q$ q& \: @5 h* v3 }" g Obj.deleteObject;
) L4 e: I' |' {. T end;
0 ] v2 H. q: s; u next;. _# i3 q* D+ V$ u
--shengcheng Status:zimoxingceng! h. l3 `. D$ ~* L6 y
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");$ z- u: A. @' n+ l) }7 e/ I5 i
Obj.Label:="warehouse status";9 ?5 z9 o7 X9 l8 y- ^; J) E
. G/ t6 x$ s2 Z8 `3 a! P for i:=1 to WH_nums loop
) w5 `; U7 \- R. z Res:=sprint("Store_",i);: N' C$ l* S3 y6 L+ I2 g) C0 U
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);8 i; r, {8 _/ h8 p" e
Obj.Label:=sprint("huojiaceng:",i);
- _: u% [9 ?+ b! M Obj.xDim:=WH_x;8 K: j1 E( [ T$ [
Obj.yDim:=WH_y;
* s9 A+ d" i) Y3 i5 f Res:=sprint("StoreData_",i);
; {% i9 j. `' D9 } % t4 ~3 \8 B7 G
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);" v+ G3 h* ]4 h4 t" J( }: f! k
Obj.Label:=sprint("huojiaceng:",i);% L+ H9 o' f% L' B9 E! b) O' `
Obj.inheritFormat:=false;
4 R7 ]* o& E% u" t Obj.maxxDim:=WH_x;
( |" K* y# p N Obj.maxyDim:=WH_y;$ i* n2 t$ g( C m: ]1 N2 I
Obj.ColumnWidth:=3;) r' d' S. K5 B
next;, p+ Y ?& Q$ f7 c! s% K
& L# u: C% h" W* `! g8 }6 n) p .Delivery.MUs.Forklift.speed:=2;+ `" P- K+ f) F* A7 | u
WH_var.delete({1,Part_Nums+1}..{*,*});
Z7 |9 t7 H) [( {/ X9 o5 z" O2 K8 l7 l1 G for i:=1 to Part_Nums loop/ ]4 @, o' o9 v! J
WH_var[1,i]:=chr(64+i);, F9 w; J. I. @/ f% g3 V
next;( q# ] A0 q, K$ C; l
end;
0 y7 c8 N( Y4 j7 Q2 ~$ S j出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ! d! c2 c1 Z- m. ^' o
/ z% \1 w; H! c" o; r" S+ i
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|