|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
1 S3 n& l0 P, S& {5 a$ d语句是这样的6 e$ p, z3 H5 s5 O5 G; f
is
* v3 _3 [& Y2 `' ]" @8 r, c i:integer;6 P2 N0 _' s8 q+ O' P8 U
Res:string;
' l0 W# |2 k; {7 I0 _ obj:object;' R0 v. r- \3 { K
do: N" X& S! q9 W J
if existsObject("Status") then+ w8 y& Z& d8 q. O
Status.deleteObject;1 B2 Y, n" N; @
end;
6 s9 F) p! A; c) | for i:=1 to 10 loop y# ^1 j. `6 m7 R2 |
Res:=sprint("Store_",i);% j% r5 I6 A1 Y- ?$ {5 Y
if existsObject(Res) then
! U$ e& g, k( ^9 s/ g Obj:=str_to_obj(Res);
! B; r, o/ l% g, W5 ^2 R U, V Obj.deleteObject;
# a. ?# R& x& F7 p& T end;
, F: B5 q4 x7 a/ q; {. V/ R5 ~' I# ^ next;* u! R% q* E h9 p9 `, h
--shengcheng Status:zimoxingceng
0 v& o3 r* d# v& p G Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
1 E' k" z6 m+ }2 S2 d Obj.Label:="warehouse status";
5 d* B/ p3 W; T3 c% C) U: H
. d+ p# N; q0 T$ k) ?0 @ for i:=1 to WH_nums loop
% d/ N g4 n! ` Res:=sprint("Store_",i);
8 n3 v7 f9 Y5 _; w0 B& S) H3 C- M Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);% N; ~3 n8 M3 D: [7 q+ p% G
Obj.Label:=sprint("huojiaceng:",i);
6 V0 ]; W4 x& H Z: O0 K8 } Obj.xDim:=WH_x;
& C j9 g' D5 @. W4 s3 Y Obj.yDim:=WH_y;
5 z! b6 b0 {+ w. w6 S Res:=sprint("StoreData_",i);
& _# b9 }% P6 m4 ^ C
8 ]0 J1 T0 t+ R/ L Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
) Y1 }. t( G2 D' N7 U Obj.Label:=sprint("huojiaceng:",i);
& c' `; k3 s& M1 L K Obj.inheritFormat:=false;
( _ d8 Q! }+ Y2 d6 t$ ` Obj.maxxDim:=WH_x;! e$ E' d; w& T. K# x& A5 M5 H
Obj.maxyDim:=WH_y;
' m0 ]. q. t% h* s& R9 w% `3 G5 @ Obj.ColumnWidth:=3; i+ c( x7 A" T2 F
next;
! ]; i) h8 m# @
8 D6 C5 @1 I9 |8 \8 P .Delivery.MUs.Forklift.speed:=2;
) {* M/ d& s; Q { J0 D# y7 ^ WH_var.delete({1,Part_Nums+1}..{*,*});
. s! A5 s) o$ t& \$ f) x# a for i:=1 to Part_Nums loop( k/ I7 n- F, w
WH_var[1,i]:=chr(64+i);
. p- I. j q- k5 @, J next;
! ^" A( Q. l! P9 M! g+ ~* Cend;: h3 |9 v* [8 \% {2 c+ w: Z
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
, g/ s% S0 y8 v0 e
5 ^5 x% @/ z7 [- i- A |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|