|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。- O% J2 y0 q4 A- u6 P" l
语句是这样的
7 S- U' C) D" a6 m0 |is
5 c& J! i4 |+ V" |0 u i:integer;
; X) T5 k% _8 c5 h8 W Res:string;- s( J& W; w* h7 c$ A
obj:object;" N: f" u& T: x# j
do5 z9 p, H0 G" w9 W- p! g9 _' o# @
if existsObject("Status") then* L+ V! _ o2 {& e P
Status.deleteObject;+ I) Z& I6 g9 t( |) B. z5 S* J7 y7 Q
end;
& F! A0 G( Z* _2 E6 P- \ for i:=1 to 10 loop9 @8 ~* X0 U4 |2 l
Res:=sprint("Store_",i);7 b* k& b$ U* P0 z2 Y
if existsObject(Res) then
* m4 Z) |; D& K/ P0 K$ { Obj:=str_to_obj(Res);+ h. E( o) o5 x$ c% B
Obj.deleteObject;
6 d$ [5 P( i+ Q& r end;
, w3 O4 X: T K4 k' k next; r+ D' H- C& {$ n4 y
--shengcheng Status:zimoxingceng
+ A7 p0 w' ^% n. A Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");. V; V' i7 Y3 ^( s9 v: f5 g
Obj.Label:="warehouse status";
5 K9 y( n7 ]6 x' h$ S% D% x0 `: b / J$ \+ U: ?( C: I9 G
for i:=1 to WH_nums loop4 l! g0 v, H* S+ W4 d4 H( w1 s
Res:=sprint("Store_",i);9 R: y* r2 t* |, t0 J2 l. R+ G$ q
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
$ u: @! v& a8 {' V Obj.Label:=sprint("huojiaceng:",i);
) |+ W2 l* }0 Q, C7 h. u o& s' B, t/ v Obj.xDim:=WH_x;
; ], g* W/ f* h; p- b Obj.yDim:=WH_y;! z3 ]9 K. w. a" T. y b. H. G
Res:=sprint("StoreData_",i);
+ @* M: S4 O4 T4 @ 3 @8 e" d- n3 i- h& l% q3 v' r
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);, o" @4 y5 k/ ^: g: [
Obj.Label:=sprint("huojiaceng:",i);0 L: M, j0 s8 c: y# k
Obj.inheritFormat:=false;
0 t, Z& w" X( Z# l I3 v l Obj.maxxDim:=WH_x;: p% ~' X. `9 v) _) p
Obj.maxyDim:=WH_y;0 n% v' j" H6 B4 _3 y
Obj.ColumnWidth:=3;7 P% S0 V0 j7 V. b8 T7 K
next;
6 s4 h5 R% R, b4 b0 x2 C . H* u7 \3 B* r6 K" |6 n
.Delivery.MUs.Forklift.speed:=2;8 v$ N) V2 z' Z1 v# h
WH_var.delete({1,Part_Nums+1}..{*,*});# n: H; U. v2 [8 e4 J
for i:=1 to Part_Nums loop
' K6 H. y% U) f6 M9 z' V# r WH_var[1,i]:=chr(64+i);$ Q) X4 R$ n% H$ ^7 k
next;
6 ~, o' b9 k) k) V" E% mend;
# I, S: k& r2 [# S# T出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 + g, R o, _9 m# v, G
. d b3 d5 V# F' C3 M
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|