|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。! ~5 ]4 d' n" C8 h
语句是这样的
8 W4 Q/ Y2 k/ M+ Y5 M) Qis; D. m0 L( i x9 W5 R q
i:integer;- `8 F8 p8 D9 A: b5 B1 L1 p& y/ C
Res:string;* p1 l r2 b: d
obj:object;' }7 I- }* Y! s1 i4 G1 Y5 E
do
- \0 V: m- W. M( D. r& T- A if existsObject("Status") then
7 d* x z- J9 [9 c/ Z; T Status.deleteObject;# K1 b* B& [* A# ~5 Z/ {3 o
end;: O9 Y5 V! n9 T( V b$ ~# w# H
for i:=1 to 10 loop
, U' `* B* c/ i O5 K9 u1 g Res:=sprint("Store_",i);
+ x" W. w. K- ^5 }. Z$ _ F if existsObject(Res) then
; z% B) V% K ? Obj:=str_to_obj(Res);
- f) j7 F) W* z9 o2 ^ Obj.deleteObject;5 c/ G$ a# h8 [/ F* c+ G2 H1 Q
end;
6 q- c$ ]) F# W next;; h) x3 [# K' Q
--shengcheng Status:zimoxingceng8 X1 n9 W: g+ } Q
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");6 ^! U6 M! m4 h% _3 c( y
Obj.Label:="warehouse status";
% E( g3 O. b& L) Z- w( P3 ^. p. o
8 ~3 x) z. ~* k5 j/ z$ [7 s- { for i:=1 to WH_nums loop
1 j& d; w- o# y% R* v4 P% B4 x% u Res:=sprint("Store_",i);
V' S5 _. r, z1 G5 V( N Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
6 t7 ?, y% n9 t5 C1 Q Obj.Label:=sprint("huojiaceng:",i);" m d! i* k5 s- n% S' ?
Obj.xDim:=WH_x;$ [- U' h: n6 q3 @4 r$ p O& `
Obj.yDim:=WH_y;
3 w- j! m) w) A6 ?8 e: w5 c6 @7 I: Y Res:=sprint("StoreData_",i);& b- L2 B4 |' B0 r3 @; ~5 H5 m
* \7 z G8 U$ @( n( H
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
# e2 ?3 `' M( p& |5 I Obj.Label:=sprint("huojiaceng:",i);8 G8 M6 W+ V; e( `* [8 r+ m+ C0 {6 P3 c
Obj.inheritFormat:=false;, n5 y! ^# X& |+ F r9 j6 T9 b2 N1 V
Obj.maxxDim:=WH_x;$ u) C" \: u9 _: \! N- y% ]- O. E" p
Obj.maxyDim:=WH_y;
0 C$ [9 o9 U `# ?$ ~/ p Obj.ColumnWidth:=3;0 p9 J: F( M/ M7 s0 _1 T
next;
3 A. Z6 ?+ h$ P- h0 ~' u8 M" W ( {# A4 v: o+ Z% Z4 h0 K
.Delivery.MUs.Forklift.speed:=2;" {8 q. s0 ^3 M, J# R
WH_var.delete({1,Part_Nums+1}..{*,*});
8 L$ e W. `( U( W for i:=1 to Part_Nums loop
I" s5 q4 {5 y2 `: d. }, ]5 S WH_var[1,i]:=chr(64+i);9 s. H& `/ q9 ]/ K
next;* y/ x0 V! ]& U; e; v; L
end;
$ h* q/ T. w- w+ [3 z" R出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 0 C& {0 p! g! L2 N3 [+ Q
+ ]' D/ N7 B# V7 B" N |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|