|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
# q9 f! G8 X+ Q. l2 F/ F8 c语句是这样的
8 K. _; X8 Z0 g6 @+ p, Qis. ^5 V) m' j: F7 d2 O
i:integer;
1 e8 Y9 a* n- F$ R9 @: Q Res:string;
) m X+ q) {3 Y* _ i4 \ obj:object;0 S& v% v0 b h& U
do
2 g* t/ _9 e/ c9 E+ c X if existsObject("Status") then/ G# _8 p/ `5 M* R2 a0 B. o* g& H
Status.deleteObject;0 e. T. v5 } F% X9 X" ]) e$ ~4 s
end;
6 |+ R* j0 a" k, M: ?# a for i:=1 to 10 loop
2 M9 ?( V9 @% H- m8 w* y Res:=sprint("Store_",i);
3 d$ V: V; i4 o; B2 [# s if existsObject(Res) then, N* e' U( u7 f
Obj:=str_to_obj(Res);& X1 G! ?9 x* T$ i' |! C6 j* o! b5 I
Obj.deleteObject;
+ x( K( Y9 f& h- _7 W5 k end;1 i/ S4 u) L8 ~% I* K
next;
" |) m0 u6 Q9 D+ k$ ^+ d# y2 k --shengcheng Status:zimoxingceng
" r2 C6 Q' N& R0 ~* O1 b Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");2 x" ?; b7 r% Y2 X0 S# |0 [4 i
Obj.Label:="warehouse status";
8 C) l- h# h9 g w5 A( E5 q
) C) q& ?8 e7 f# t+ L4 i K for i:=1 to WH_nums loop- O8 ~0 ?* V) _3 c m) U
Res:=sprint("Store_",i);8 j! B3 N( b9 z4 I; n. G
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);+ l+ [7 r+ v5 q x
Obj.Label:=sprint("huojiaceng:",i);
( c3 z3 x _* F6 I/ b Obj.xDim:=WH_x;
9 h6 N0 g8 Z0 g9 i) f; ^ Obj.yDim:=WH_y;+ P8 J; Q7 Y4 X; B9 T9 O# s
Res:=sprint("StoreData_",i);2 a+ O" l! W# u( h
) x0 [3 a. f7 I$ c6 x
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);* x! b: }& p. j; ]
Obj.Label:=sprint("huojiaceng:",i);
# d" Z* e* x. T9 f& o$ n Obj.inheritFormat:=false;1 {' u. E. l. r! Q, d
Obj.maxxDim:=WH_x;
# ~; {3 Q5 h3 g1 u. [! D Obj.maxyDim:=WH_y;
- N/ k6 ^% X) i2 D) Y% O* |9 u) z Obj.ColumnWidth:=3;7 {+ }( Q4 M3 P% r5 I& |9 {
next;* H) m# o& a( s3 D Y. h
7 F! r& n8 M- w7 {
.Delivery.MUs.Forklift.speed:=2;0 P! c* j0 s) Y7 S+ W n9 L
WH_var.delete({1,Part_Nums+1}..{*,*});5 W/ x4 s' t" c9 o, b/ |
for i:=1 to Part_Nums loop
7 K3 D# _1 \- Z1 k( M% z WH_var[1,i]:=chr(64+i);5 E& M3 a. n n2 V" K$ A
next;( W& Z: A/ o. t. }6 s; g# l6 R
end;% y" m1 G9 S3 w1 D3 y
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
1 u% g8 R# W) Q
" X5 w: T# _ p |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|