|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。. ]1 |( b3 o+ m: ]0 C
语句是这样的6 `+ h4 G6 y+ o0 K5 A
is! N( {0 k" E7 g5 t! ]* d) z" X
i:integer;
: ]. e: N0 C- a$ C( e @! h0 K& P l Res:string;
. e, n4 f* [. H obj:object;
6 S; U" `# b8 E0 {5 t& g: Ydo
. d$ B% o; _0 _% f5 n if existsObject("Status") then
6 \: j& a) }4 Y Status.deleteObject;
3 u* y a8 |3 |5 k# W; q( w3 B end;" {( v- \: f* D# l8 W
for i:=1 to 10 loop
. q7 _. Y/ M6 h \. i3 A9 v* S Res:=sprint("Store_",i);: p$ @1 R! d: I- ^7 q% ^# `
if existsObject(Res) then
0 u+ p9 N; d! J" g) ]0 d; a Obj:=str_to_obj(Res);( p+ B- u" K, N5 s9 C$ J0 j
Obj.deleteObject;# Q) K4 J! S" n$ d* S
end;! [# Z: m! Y3 h2 K& `
next;
9 g# Z$ U. ?7 W% |- P --shengcheng Status:zimoxingceng
7 |* i7 [0 a- ]- Y' E1 L9 K6 W& i. z Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");6 z4 v. ?$ w8 H+ ?$ O
Obj.Label:="warehouse status";' z9 a8 g& _0 a
. D, b5 R3 j& r" Z& N$ L7 O4 g
for i:=1 to WH_nums loop
5 m4 V/ Q' q+ Q. J3 S Res:=sprint("Store_",i);2 [9 k# S8 J) L H
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
' B" L0 m% |& s7 i9 J Obj.Label:=sprint("huojiaceng:",i);6 m2 l8 |& t/ W6 v: t) t' D% M* x# T
Obj.xDim:=WH_x;, q( n* M0 u; @" M/ m
Obj.yDim:=WH_y;6 k; E7 W) V6 p" v" F0 Z6 G9 C
Res:=sprint("StoreData_",i);& h* g' ?+ }2 y* s. [2 L- k8 Z
7 ^. v) @7 H7 H1 z5 V
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);2 I4 [1 R2 Z) M/ z0 o
Obj.Label:=sprint("huojiaceng:",i);$ S* @6 g3 j; c
Obj.inheritFormat:=false;
) r) F2 N' U# W1 I- f. d- L Obj.maxxDim:=WH_x;
, N7 {+ s& M: t c. w Obj.maxyDim:=WH_y;
' S' k4 u0 e' L* B8 { Obj.ColumnWidth:=3;
0 F' R8 d. `4 n* U" _ next;
; s1 J8 g1 F' v. z% ]$ |) H & K% W7 ~5 g+ j: p
.Delivery.MUs.Forklift.speed:=2;
% Q6 g4 ?2 @, S3 _7 B" Q WH_var.delete({1,Part_Nums+1}..{*,*});6 w* c+ M& f$ L: {
for i:=1 to Part_Nums loop
' k- y! K3 v i0 J' m6 I$ I WH_var[1,i]:=chr(64+i);1 l# i) t6 d# Z) c, C
next;- D9 O3 D2 B; l$ r& [& p2 `& ]
end;
, b" x& e1 p/ n0 v+ R出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ; t* M7 N; `: t
- ]3 Y- c& |2 K3 U# C H
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|