|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。% t# p- g1 F' R, q& Y
语句是这样的
6 J$ C# a8 m( b: \+ Y2 X: kis1 M+ Z" C& K. x
i:integer;# U. W2 B8 T3 \ x2 `1 j5 i
Res:string;+ s- K1 {! F; n
obj:object;# e2 h5 v, B: m& N
do0 Z! {8 a5 {, d) a3 v8 B/ B) x1 |; k
if existsObject("Status") then1 Z% [* ]$ {' Y& P' z: f. S: P
Status.deleteObject;
$ J2 p. E1 ^; ?$ B1 B+ h end;
4 E; Y/ [ D& }1 ~+ f3 X: W for i:=1 to 10 loop3 |# y8 R1 R& w5 |* [
Res:=sprint("Store_",i);! w* O+ K1 D* {4 G' b
if existsObject(Res) then
* j, E1 B2 R* K Obj:=str_to_obj(Res);
0 \& g$ u; P- A Y5 K5 W Obj.deleteObject;
* \$ W$ P/ G2 m3 V end;
. [3 w0 Q7 Q$ g% y( s) l next;2 t1 O* d' h4 K+ f/ C6 s
--shengcheng Status:zimoxingceng
3 Z7 U: e" ?4 D* {2 ^ Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");0 n# s$ W- W( L. p* L
Obj.Label:="warehouse status";
# `& l& ^# M2 P( Y) M" h 6 U1 N3 z0 m. f( E' J( i, U
for i:=1 to WH_nums loop
2 _; M: c' }% F C' _" _ Res:=sprint("Store_",i);
_3 }) y8 C" N; a4 a& T `( v Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
) k3 M! X- M3 H+ c Obj.Label:=sprint("huojiaceng:",i);
3 I2 c, c3 }' }& Q2 t6 r Obj.xDim:=WH_x;
F0 K5 F0 x Q" V% m% e Obj.yDim:=WH_y;# q2 F4 V$ q2 }- A1 f
Res:=sprint("StoreData_",i);
" c: ^( m4 V# u7 L. }2 c + [# _7 j) W3 }8 S& H: A" v
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);0 }7 d: N% Y1 e7 Z* g( [8 h
Obj.Label:=sprint("huojiaceng:",i);
2 }" H) Q* ?1 e Obj.inheritFormat:=false;
0 t+ P; u( w; [ R! [2 I Obj.maxxDim:=WH_x;, j8 U' J ^2 }5 p C' f, T
Obj.maxyDim:=WH_y;! b' G. s) [4 i2 e; D+ O
Obj.ColumnWidth:=3;0 {0 s% T0 b/ M7 t6 f; f
next;
+ ~$ H) B$ ^+ r; w
+ d& V) o5 S7 S9 w3 f1 P7 Y! q1 `; ]4 ^ .Delivery.MUs.Forklift.speed:=2;
; c6 Z( N4 I2 } u0 T, @ WH_var.delete({1,Part_Nums+1}..{*,*});
" u" G; o% v, O! m+ q for i:=1 to Part_Nums loop
; x# l2 L. y* z6 I6 x& o WH_var[1,i]:=chr(64+i);
0 z% L% G5 ?$ c! }5 Y4 @* G: D* ` next;
; S* B( E( Q2 O. Pend;
" V/ i% X% i( f4 e5 b5 n出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了) }% v% t) D4 P( @" e, U
x3 w o2 c* e' g |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|