|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
% a& u: j! ~7 t5 E" A2 H0 [1 U语句是这样的 q6 D2 y6 t2 c8 i- y
is2 E* G [- Q$ @' q
i:integer;
* R4 x" V" Y; [. n& B. Q+ p! a4 ~ Res:string;. f2 Z* H5 v% I, j7 @
obj:object;
: |& L! }( b2 J6 `0 O$ N( l$ } L! ^do+ ]4 @) ~) e" J! c+ W: _ T
if existsObject("Status") then
4 v8 |7 T* [) ^( Z8 W Status.deleteObject;
- w" K% p9 o/ V; R* I2 G7 p: o! S: t end;1 W3 J" K9 C) [9 n' z
for i:=1 to 10 loop; _. |4 D! {# |: K/ F5 Y9 U4 ?7 U
Res:=sprint("Store_",i);. c' D+ y! t: w( p6 n
if existsObject(Res) then2 u2 S+ B7 v0 ^5 H( n
Obj:=str_to_obj(Res);% a$ p) U$ F" v" y+ B y) h4 c
Obj.deleteObject;
4 m1 S2 {3 e* e end;
0 E" p. {8 \9 U" D0 o0 |) L next;1 J- `( u$ P% a1 @# g4 I# Y+ ^: a
--shengcheng Status:zimoxingceng) m O9 ]0 S" {1 g6 _
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
/ K% p5 F. X! I; ~* I4 C Obj.Label:="warehouse status";
" b1 W& b8 c% V; A6 e/ Q+ y' i
& [# b6 W& L2 R8 g7 R3 Q# |% x5 j for i:=1 to WH_nums loop
; p1 P- K& f- x: h" a. c Res:=sprint("Store_",i);
6 t/ l" U" ^- L+ D, S: T Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
% Z6 }" H8 I3 V7 ^& T# H! Y Obj.Label:=sprint("huojiaceng:",i);6 R6 t% b+ F8 a2 r. I" H
Obj.xDim:=WH_x;
4 v0 G0 [; Z1 v' u. z Obj.yDim:=WH_y;
1 z8 R" |% s+ L& h3 Q" C Res:=sprint("StoreData_",i);0 h( t' o. A) w8 n" u8 F% x
) _2 O1 [9 ]+ p3 @8 ^; b Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
" K; N6 R* W' F* r/ ` Obj.Label:=sprint("huojiaceng:",i);8 `; {7 ^5 C% k0 E
Obj.inheritFormat:=false;
w0 g4 O3 @7 p, [) Z( k# d Obj.maxxDim:=WH_x;
! G! W% Y4 e Z" s0 k Obj.maxyDim:=WH_y; q# B3 J* l, t; [
Obj.ColumnWidth:=3;* ~5 \% E; W* _) Z& e7 K
next;2 f" p# Z7 Q( S" d% V
; ]0 @# s2 V/ E- j1 D .Delivery.MUs.Forklift.speed:=2;
* A6 s) c1 A) X4 ?8 }; k$ N6 r2 B WH_var.delete({1,Part_Nums+1}..{*,*});/ R1 R( j+ w- A+ A( n* t9 c" a
for i:=1 to Part_Nums loop: g0 ^. J; X) G5 ?9 k, D
WH_var[1,i]:=chr(64+i);
' x9 A& v* A1 C( h3 A' b- @ next;5 b2 e- u }8 y
end;
& f- c4 [6 t1 g P4 w2 `3 V出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 L! v! S8 a6 b' n4 W$ |+ U
7 Q4 P, t0 h; l# N8 ? M
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|