|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
2 J5 q" P2 x1 C4 b6 s语句是这样的
" e, {7 w' D, T* C h0 @$ q! ~is
$ ]3 C C/ e" Z' J m m$ K i:integer;$ P2 r5 b- _0 j0 s) j9 p4 |
Res:string;. H: ]8 R+ o! H8 Y
obj:object;# E" S$ S3 a. X
do
3 O' d; f1 S( o1 M! D* d" D d if existsObject("Status") then
, l p3 q4 W( j4 f8 n* X- m; Q Status.deleteObject;
4 A) k, H/ c! j2 O$ k end;
$ b4 D8 }! |/ d0 l! D. [ for i:=1 to 10 loop
& ]0 L( ~& T I0 A' q) C6 o# Q l1 n Res:=sprint("Store_",i);/ r* Q" C' }) s8 j3 ]9 E2 H) k& h
if existsObject(Res) then
/ \7 p7 B9 g1 L: Z. Q( F; i: K" m8 Q Obj:=str_to_obj(Res);2 n; ~+ ]/ L* q0 e6 ]$ K
Obj.deleteObject;7 q, S+ _( U# j. ]; k
end;; [1 x; Z9 @/ J' ^5 b
next;* r# G2 d8 w( Z1 N
--shengcheng Status:zimoxingceng
( q4 w& L i# x3 C- z- Z Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
3 V! Q# g: u3 x( M$ z# ?4 f Obj.Label:="warehouse status";7 l" X n: p4 |: B2 Q+ ?: G% I9 N" M% ^4 |
' s" p* L' Q: `; y$ }( u8 T for i:=1 to WH_nums loop
$ V$ o8 Q8 G" [3 y Res:=sprint("Store_",i);
- E0 n9 ]. ^1 K$ y6 [: H$ @ Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
( o! K- Z9 |# w5 Q" G; J Obj.Label:=sprint("huojiaceng:",i);
* i* O4 H. u5 c2 d Obj.xDim:=WH_x;& K3 K9 l. P9 }+ @
Obj.yDim:=WH_y;
, M0 i7 P7 D$ o/ d# d3 w0 q Res:=sprint("StoreData_",i);
; t5 _ A6 z- G 0 c- Y j% N/ j( m3 X" w5 R$ b
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
+ p6 c) U U8 z, t1 z. P Obj.Label:=sprint("huojiaceng:",i);
% p, t1 j- B( t! p Obj.inheritFormat:=false;
' \5 w2 j* o P) x- W; i0 T. L Obj.maxxDim:=WH_x;
* {3 C* e% l5 b i Obj.maxyDim:=WH_y;
( }( f6 X1 j8 L3 L' g* k2 R Obj.ColumnWidth:=3;! J& [& X5 @ w0 j) N- |3 ]+ C
next;
2 O2 j" _) g. P& V) C* u
: e7 d4 K9 w1 f* B* V .Delivery.MUs.Forklift.speed:=2;
n) F" S P( O+ k WH_var.delete({1,Part_Nums+1}..{*,*});: p- T' c8 H! Z; g5 M: X, V
for i:=1 to Part_Nums loop9 c2 k$ ~8 V' j& }
WH_var[1,i]:=chr(64+i);
- X& X3 i. Q: p* s next;
7 f6 X* j1 j' x2 {end;, f4 t1 W0 X; k: u& t% ~! ]
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 & N# Y' U. `! y; s( ?$ ?: m5 g) h
1 t. _* \$ p7 I" K6 ~- \ I
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|