|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
W. j9 f" K8 H2 k+ Q; Y7 u, o语句是这样的
# T( G9 J% z9 ^ {1 ?8 {# iis# C r4 J( ^+ w- v- A
i:integer;5 a% P2 J9 i) S/ q/ f% d8 h
Res:string;7 _% Z) c) C V
obj:object;
4 M3 E% V4 G" s8 B) G2 Q5 C8 ~2 Ydo% N7 h# ~) V$ Y8 t; q6 A
if existsObject("Status") then8 F! U" Z' B- j8 ^- g
Status.deleteObject;( E5 Y1 I0 @9 Q }. r7 a$ P
end;; p) L. L1 h. V
for i:=1 to 10 loop
) s$ x' U, Y: ~3 \* |, A Res:=sprint("Store_",i);
% J- M# K+ Y) N if existsObject(Res) then1 k) W2 I+ _& v1 i9 e1 n& a
Obj:=str_to_obj(Res);
7 x" t X7 |( h2 W5 z2 ~6 Y. E Obj.deleteObject;/ r: c8 \( m: h- Z' G
end;. h5 r$ y) w7 D% O( ~) R
next;
2 z! x, C, h3 Q) ? --shengcheng Status:zimoxingceng$ ?( `1 @& Q5 m: \5 k& I! h/ F
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
- Z* l5 J; t. N7 {/ m0 i- ]7 N. m" b Obj.Label:="warehouse status";
! I$ a- p4 I) x% n& h ) r3 V3 W5 ^+ T5 o+ b# \. `1 `
for i:=1 to WH_nums loop0 D! ]- L% L2 ^/ [
Res:=sprint("Store_",i);3 ?# Y" l% H6 B( i2 ?& B
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);% u( |9 J: F. i6 Y8 T0 Z, Y; x
Obj.Label:=sprint("huojiaceng:",i);2 f8 ` X9 y8 ?7 H
Obj.xDim:=WH_x;
8 V" Z& a7 I8 b Obj.yDim:=WH_y;" ]$ h# O! x9 |1 g0 Y) W- U: r- a1 p
Res:=sprint("StoreData_",i);
2 ^* l5 \% Q) G# I6 T9 l
5 K4 @8 c) u/ T8 E% M' H9 F+ q! r' k5 L Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);3 ~6 v+ U6 W( y3 I0 [0 F
Obj.Label:=sprint("huojiaceng:",i);
9 m) n- C! X) x6 T8 p0 o9 R Obj.inheritFormat:=false;
0 Y5 v# H, g7 _5 z+ p" w- L* W Obj.maxxDim:=WH_x;1 }. r6 n- M) U8 d& r
Obj.maxyDim:=WH_y;" X3 f6 n( M9 M9 u7 D
Obj.ColumnWidth:=3;+ g& ]- b0 i6 a3 n* L. q
next;
- k/ i: I) y! \. D! u8 [. K, W ! Q' S& D) k* j0 m
.Delivery.MUs.Forklift.speed:=2;
+ R) p& V! U @6 H. e WH_var.delete({1,Part_Nums+1}..{*,*});8 z/ c7 S; Z2 U
for i:=1 to Part_Nums loop, D. p8 {/ x8 T' j
WH_var[1,i]:=chr(64+i);
/ w# B4 L* i' v+ s1 ]; ?4 u next;- `" ?& J, X& f' k6 O
end;2 q* w1 {" D. @& P# Q" Q3 s
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ( N6 N( I" V- I2 X
8 S3 X9 A* t) }7 M
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|