|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。8 k6 k* @2 `% Q f
语句是这样的- G: Z! ^9 I$ a' i; F$ y
is7 p4 F, |/ s/ n
i:integer;
0 {( ~+ a, X# _& T5 e: L; u Res:string;+ J8 {6 L. Y2 ^$ x3 G4 n
obj:object;4 G% u1 x6 N8 b# z
do
( J! c3 K k8 O" f1 E: w6 W if existsObject("Status") then- D T+ V. z! g( b8 F
Status.deleteObject;
* g* {+ Z# o# z$ u! Y7 J7 O% M% M end;9 l8 k1 S9 ]* h9 ^4 n
for i:=1 to 10 loop
8 Z6 i3 r @/ ]# }" p4 C6 v+ _ Res:=sprint("Store_",i);
$ ^$ _" k9 j& U/ d& B3 a# q if existsObject(Res) then5 Z% {7 g8 |" U" w) w0 |. |' S- w
Obj:=str_to_obj(Res);
' u! Q! e1 |0 o) ~ Obj.deleteObject;$ H2 E* b @" X8 D3 H$ m$ o
end;4 w0 Z) K# j4 }+ a. x5 z
next;
N" v9 n6 s8 o6 p5 r --shengcheng Status:zimoxingceng; I) s5 x& S6 @; i2 L/ s2 h6 X
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");. }" g, ?- |1 C9 b0 L \* z
Obj.Label:="warehouse status";
; }( o% Y, T5 O# _( x " m; t% M1 U) A ]4 u/ L% ?6 c
for i:=1 to WH_nums loop
8 H$ ]) X0 s. ^ Res:=sprint("Store_",i);
- N) Y/ V) p% V) O5 b Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
7 n l, _8 X. Q, G ?: W Obj.Label:=sprint("huojiaceng:",i);
: z$ M5 B8 K. R5 u+ J* k Obj.xDim:=WH_x;
1 y( m! r5 d) u3 f" ^8 P; X' `* R Obj.yDim:=WH_y;
0 T' g- G( s" |( E. ^ Res:=sprint("StoreData_",i);
( d Q, H6 Y- I0 S6 }1 t) J9 r6 s
. L1 S! A! |# Y Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
1 }0 c; O6 H f) V0 D Obj.Label:=sprint("huojiaceng:",i);
: K1 a+ z' c+ U. W9 Z0 U Obj.inheritFormat:=false; H$ m( l) U+ l. s
Obj.maxxDim:=WH_x;% s( X. g# Y+ n8 [ P( q
Obj.maxyDim:=WH_y;
" t. u q a6 J/ b0 ?; e Obj.ColumnWidth:=3;
- q4 A; m' z$ H5 B! I% V next;( c: o# X6 c2 J* `: ^$ Z! F! {9 `
: l+ j0 @( [! i; c B' Z/ w .Delivery.MUs.Forklift.speed:=2;4 ^4 {0 H7 v5 r4 E; V7 ^' t
WH_var.delete({1,Part_Nums+1}..{*,*});: ]; H6 d* h g
for i:=1 to Part_Nums loop& Z7 n% X' _6 }' {: i
WH_var[1,i]:=chr(64+i);$ W) ] z5 I ~/ q
next;7 U. o0 j% q4 K ?( D1 i
end;2 O0 d& F) [6 p. W
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 2 |% q+ \) b8 M7 R2 d& m( Y; R' q
/ i! Z. Q& n" ~
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|