|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
/ z& H) \2 d' M4 ]语句是这样的- P4 c! a N1 u: E
is% T- B: I; H+ c6 v: S0 a
i:integer;0 M+ U: Z1 O" p! k0 W! d
Res:string;
- V( r1 k2 @# T! r4 M2 ]9 K8 Y0 \ obj:object;5 y) K! Y1 t' c1 [
do
" Y6 q( Z3 L) i- e8 H+ { if existsObject("Status") then2 E, [; W' N4 ^5 `4 n$ w: f
Status.deleteObject;
% D7 x0 g _5 N; y( Y* a, z end;; q! a3 @" Y/ `; Z' z
for i:=1 to 10 loop, |0 \( n7 n& q* X4 |8 r8 a* ^& z% g) ?
Res:=sprint("Store_",i);
l+ L+ {- g% b$ X7 g if existsObject(Res) then% b- V2 q. Q2 k6 k' w
Obj:=str_to_obj(Res);- P, }$ H, k2 h6 l+ S
Obj.deleteObject;
- ?$ E: q( [5 m5 ~1 h) P# y end;- z6 a8 F0 B2 ^) d. m8 {
next;
* v+ v- L) b, I% @7 u9 J, N/ ]$ e --shengcheng Status:zimoxingceng
" Z5 ], A; x& k7 D, Q2 q Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");- {$ `* y. H# R
Obj.Label:="warehouse status";
) u$ J. T% d7 R9 ~+ S
! L M) [, n1 @" m `* R for i:=1 to WH_nums loop4 r# i& r) n8 t
Res:=sprint("Store_",i);$ w6 O* b7 V4 ^7 l+ J3 L
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
^9 F) A/ f$ V) o; B Obj.Label:=sprint("huojiaceng:",i);2 T A6 l4 y5 ]
Obj.xDim:=WH_x;
, W5 K8 T4 y% h8 `8 a' Z. k Obj.yDim:=WH_y;1 s2 T! Y) \; ]) k7 l/ I! I8 p
Res:=sprint("StoreData_",i);
$ ?' v, [0 B, m( z: K' {
1 ^* M% e( z: R$ M) Z Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);4 a" f# R* k) M2 S1 \" ~
Obj.Label:=sprint("huojiaceng:",i);
: ~& t% Y I, {2 c- x Obj.inheritFormat:=false;. n, W! {, j. l+ d- q: D; G
Obj.maxxDim:=WH_x;
% a4 L7 {; f4 h( b1 C& \ Obj.maxyDim:=WH_y;
0 l( A; G A. o( d. t4 Z Obj.ColumnWidth:=3;
% F' `6 U) M8 B8 u( y! p next;
* ~% I% v$ T' o6 e/ y 2 J% i' H- q# f2 D `0 S
.Delivery.MUs.Forklift.speed:=2;
M1 ?8 x7 d$ d2 y) d WH_var.delete({1,Part_Nums+1}..{*,*});$ [: }& {; x$ `9 X- ]+ F
for i:=1 to Part_Nums loop6 z1 d* K7 s; t3 d# D& m, d
WH_var[1,i]:=chr(64+i);3 `$ |" k. ^' ^9 d4 X1 h
next;
1 P4 d7 A5 }2 l' E2 wend;
! O( U- F4 j3 A% Y& |7 E" w6 g, z F出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 . @! y, I/ c% e' o
% h4 S$ t; o. B2 c2 M! p |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|