|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
% e, H6 G# r* a3 h3 t) [语句是这样的3 W, t) n Z' G: b9 p
is
% [2 F$ x6 Q, ]9 c i:integer;
+ p5 q0 b/ y5 [ Res:string;/ E6 [) a" U5 G
obj:object;
" w' h) [3 Q: P$ Y4 Xdo
3 e. G! T3 o3 p4 ~" S3 B if existsObject("Status") then4 @. V' [9 o0 o, |3 Z. }0 h
Status.deleteObject;
5 x7 f* j4 l6 ]7 z4 M$ Z end;
. }* n; {: p, v% a for i:=1 to 10 loop; U5 { f ~ P B" c! ]0 W R
Res:=sprint("Store_",i);1 k6 A T6 Z! ^5 ^$ n
if existsObject(Res) then
^0 H" `$ ^% a1 y* h Obj:=str_to_obj(Res);
- W! f |4 r7 {1 f Obj.deleteObject;
; |8 l6 ^# Q6 x3 R end;$ F/ g9 F2 H+ p' C% _* e/ R
next;
8 \% B! r8 B: ~) i/ z% O: T U# K4 M --shengcheng Status:zimoxingceng R1 E; a. Y! ~! o6 ^, ~
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");3 ~" A0 O' C& o! Y( q
Obj.Label:="warehouse status";
' J% m* q# I6 B" p4 R h. [
! D( \ s; _/ ? for i:=1 to WH_nums loop
# q+ t6 f3 \+ l2 G( s X Res:=sprint("Store_",i);7 q! k/ j6 j7 I5 b5 F, n
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
1 B( J6 P* [7 o( H Obj.Label:=sprint("huojiaceng:",i);
0 }0 Q4 Q' E: z. q' N, \ Obj.xDim:=WH_x;9 @- [7 @( d& P. r0 o6 \. e( o
Obj.yDim:=WH_y;
, x6 y( ^8 ^ u) s Res:=sprint("StoreData_",i);$ W" O% Q0 C1 x% e: @
- ?; Q) s) G# `1 {$ V
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
8 U; Q' _- [# e I! u: p: r8 a3 Z Obj.Label:=sprint("huojiaceng:",i);
; j6 c1 J1 ~9 m. ^9 ^. k0 B Obj.inheritFormat:=false;1 @& u& s0 R8 @; I- o4 g3 Z
Obj.maxxDim:=WH_x;
: }3 n5 H5 `; e$ @2 d" E+ E Obj.maxyDim:=WH_y;# {7 f, P) e' ] d* n; |2 I
Obj.ColumnWidth:=3;
9 j2 k6 d0 G8 w! f. ^8 b7 Q next;
# A- K" v3 _. W$ w" c w 7 e8 ~1 v$ b/ W0 K4 o3 D8 D
.Delivery.MUs.Forklift.speed:=2;+ }0 m1 Q/ L9 b4 S
WH_var.delete({1,Part_Nums+1}..{*,*});4 B) n9 R% x& B, q! `" u
for i:=1 to Part_Nums loop9 h$ B0 B$ J1 M% J3 L
WH_var[1,i]:=chr(64+i);
. e. I2 t& D! K& H9 f: d, e next;+ z7 _/ r4 P4 x' A6 e, u) Q
end;' j7 I& B9 i9 W/ \- k. u9 d, D
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
) q% r9 S. d, M: n. v1 Y9 q5 B* I" d$ z) z& c! M6 {: s, w+ A
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|