|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
% p* L' t( p4 ~5 d& c" f& Y" C语句是这样的, H5 O2 N; ]3 M' B; g' N5 D
is
# \9 m$ X; U1 q# W3 k( N( J* l i:integer;* Q, k ?$ w7 E% ` k; S- b) A6 A7 ~
Res:string;8 B# ^: f/ n% \# R4 H' o
obj:object;
M" ]: d4 X4 kdo
, M. p5 j# j: L+ C; G if existsObject("Status") then
* L0 K7 y6 Y( D, g# y Status.deleteObject;( d1 G+ n- H0 [. ?4 P' b
end;
4 y6 n$ C1 N/ a6 t& [8 E$ f for i:=1 to 10 loop
7 w! W6 O; M2 n Res:=sprint("Store_",i);
) T; q- i4 v1 _/ s0 { if existsObject(Res) then
8 V0 o* o, S9 l8 ~4 } Obj:=str_to_obj(Res);
+ z6 {5 `3 R7 h; B" ?/ Z+ H Obj.deleteObject;
; @6 E( [, H+ H' b+ y- w end;: f$ ?5 `$ k1 r% x7 F1 L
next;
7 F9 E6 v, X1 q& A4 K* z. d7 p --shengcheng Status:zimoxingceng- V5 Y6 ~% G& { _7 W% @4 O
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");2 K8 R6 j& s1 j5 Z& l' Z: m; K
Obj.Label:="warehouse status";
% K7 r4 c3 s# ] |
+ ?# \( |+ V7 y, j2 v" V for i:=1 to WH_nums loop* h* v5 W5 O& o2 |! b5 f$ {8 N
Res:=sprint("Store_",i);2 k% n" v, |+ T
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
3 q+ R s( h- V6 X. Z/ C4 B4 W Obj.Label:=sprint("huojiaceng:",i);% Z6 k1 D" H- n- C
Obj.xDim:=WH_x;: ~1 y; Y. s) G4 s% j% p, m
Obj.yDim:=WH_y;/ F. X: X* q; w
Res:=sprint("StoreData_",i);
' d% Y1 F' v; Z! R, _' _ * P% h0 D% w, n( I! A( ~7 j8 x
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
% b- A& Q" R# D( A0 Q Obj.Label:=sprint("huojiaceng:",i);' ?7 w" U, c! @4 Q9 V) P6 d
Obj.inheritFormat:=false;
. I, I; Y+ R R0 K, s% i Obj.maxxDim:=WH_x;
: i, w q5 R# H% P* \$ Z7 T Obj.maxyDim:=WH_y;
4 V! D4 u/ i6 X; t$ z Obj.ColumnWidth:=3;
3 n& `$ \8 [; h8 c5 [9 @ next;" O+ ]0 a3 Z6 {9 G# u( O* E
/ c- |; k( j- c' E/ N
.Delivery.MUs.Forklift.speed:=2;
6 N0 m% H" P! v6 [. f; \/ `6 |# S$ R1 s WH_var.delete({1,Part_Nums+1}..{*,*});
( `+ a* L/ T5 _6 a9 k1 O6 ?' d for i:=1 to Part_Nums loop
, c: {. j' @9 Z9 i& k: v WH_var[1,i]:=chr(64+i);# s- }) c1 t+ J/ X' r
next;
, D; f4 n! P* t2 ?* t: oend;( L6 g B6 f* m
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
J8 R7 s8 X; U& Q
& H1 p" j1 n" k; Z$ W9 u* R! C& L |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|