|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。* O' H! W+ |" d+ t+ K. A# u
语句是这样的
) @# e& `0 o6 D6 A9 z" \. N I+ f' u4 Iis
7 q0 w3 p: j7 a2 S" Q* j# I i:integer;( H3 P' l7 g/ z- m4 K& n- V" R
Res:string;
5 s6 E4 B* c2 K Y# a obj:object;
/ R& J8 l) d) N( d" `4 C: ado; l: x3 u6 a$ U4 c, h1 F% N
if existsObject("Status") then
( H: e# v- W; X+ P3 c7 Q( y Status.deleteObject;! u* g/ }# M) X# \( l- X
end;" d+ O) _6 g( P
for i:=1 to 10 loop/ N; ]/ A3 G& t; K- h. S) Z
Res:=sprint("Store_",i);/ R1 w( p: O) |/ ]
if existsObject(Res) then
7 c" j7 ?& |$ i6 v8 f r Obj:=str_to_obj(Res);3 j. P$ ~5 l6 T
Obj.deleteObject;
: C, ?9 U/ c- C/ o end;" S5 e& Q8 i- l* y, R8 H
next;
) G$ u+ V5 }" H --shengcheng Status:zimoxingceng
7 n$ f; m8 D' O) t* w Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
4 i) z7 b8 l. X: f Obj.Label:="warehouse status";
- f! s ~# }) s0 t% N f* H
$ e+ F5 q1 G& S/ w, D7 \% p* T! P- y, ` for i:=1 to WH_nums loop
* L' [$ W. D6 ^" e- f Res:=sprint("Store_",i);
# Z/ F3 r1 Y1 c- _ Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);1 T5 q7 n8 O, J( z7 F
Obj.Label:=sprint("huojiaceng:",i);
2 I$ T Q- \4 U0 ^1 w Obj.xDim:=WH_x;
; h) ~' n4 C4 h/ `7 [- ? Obj.yDim:=WH_y;
( j+ W, \9 _( |- g5 ~/ F Res:=sprint("StoreData_",i);
) P6 c6 Z1 {' d; Z% f+ c( c( S) A & m1 v2 O' c6 a& u' Q+ H$ V, F$ k
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
1 g# d+ G! Y! J% v# s t$ e5 ^ Obj.Label:=sprint("huojiaceng:",i);
: ~# }- I1 Q9 j, ~3 ~6 O, ^& K Obj.inheritFormat:=false;
J S4 Y; @3 Z# Z& h1 Y, d Obj.maxxDim:=WH_x;3 l8 W3 Z9 O' r* F
Obj.maxyDim:=WH_y;
2 w0 q# m# y j+ y Obj.ColumnWidth:=3;5 x! O# P1 s X8 I1 c
next;4 B" S2 B3 e: u5 z/ J
, t% W6 d! a, b* q: J: m .Delivery.MUs.Forklift.speed:=2;# |* O. m$ r0 B$ O8 l
WH_var.delete({1,Part_Nums+1}..{*,*});
# O2 F0 s5 S; ?4 i/ F for i:=1 to Part_Nums loop; o& F: D% e. v: p8 r
WH_var[1,i]:=chr(64+i);
1 t: e3 N9 Z) a8 s: V0 F+ H next;
0 \- E/ w3 D% l0 E* }end;
/ f, T; d* W. K# X4 O# @, w出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
$ ^% K9 H9 Y5 i( L# ?+ p' M' O4 G: x. B5 \7 @! G3 f
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|