|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。& U. z! ]. i9 b) V+ d" _3 `. F) J
语句是这样的
f7 o! ~# a! Y/ O) c4 l0 Bis/ x; t: ~5 K7 v2 }
i:integer;, Q8 L( T, ^0 q/ N
Res:string;
* C, U; _9 w/ K: M, z2 Y obj:object;
# s2 S# J2 d, D/ A" m/ Wdo5 ?. I+ e$ z% `
if existsObject("Status") then+ x- b: k* C$ }* ^% h# l! \
Status.deleteObject;
, P; t( J$ J9 H6 Z3 n end;7 p. z" S( w6 n; P
for i:=1 to 10 loop
: s* P; m1 b) v2 ~7 x Res:=sprint("Store_",i);
4 o2 t, _+ v4 m' A( V: F if existsObject(Res) then
9 S/ I# y* Y$ b; F8 i: Q Obj:=str_to_obj(Res);7 X: l5 U _2 p4 b; l& W8 D# M' R! |
Obj.deleteObject;& J8 @3 s' F; G8 c
end;
# @9 e+ E' k0 ]. ]+ h! E8 v0 f next;. d" a E. G+ A( p/ ]
--shengcheng Status:zimoxingceng
$ g" r! S" y, e) J2 G0 ? Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
$ t4 a7 d! A4 f" o Obj.Label:="warehouse status";
# m/ t& v1 _+ p2 s$ O* B' C# j/ p! d " x3 x0 W- Z4 F1 ~* f
for i:=1 to WH_nums loop
: ~- a" Q5 D2 ^. y5 a Res:=sprint("Store_",i);
4 j+ L' W9 M/ S4 ~ Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);4 t2 Z/ x7 Q" ]! `1 W$ S
Obj.Label:=sprint("huojiaceng:",i);/ p, W1 T. |- j3 r. K& r
Obj.xDim:=WH_x;0 s" ^6 ?. C- }8 ~
Obj.yDim:=WH_y;. t3 }, a( K- A2 I0 f
Res:=sprint("StoreData_",i);2 U8 C0 r' g% Z4 `
( P6 K; ^4 a! ^ Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);0 A, x( e \* v/ e( m2 h: y t
Obj.Label:=sprint("huojiaceng:",i);( a9 R+ k, ^) x# t1 w
Obj.inheritFormat:=false;' x4 {* ?$ A$ `8 s1 N
Obj.maxxDim:=WH_x;
% Q: m; _! U. \# [! j Obj.maxyDim:=WH_y;
/ x/ ]& l* y# j2 j; _8 @; J Q- G$ @ Obj.ColumnWidth:=3;
* \% g. d; G1 s8 k# k. o1 B next;
( ]) \/ B2 z2 [
# d, E5 k0 V( ^* n! G .Delivery.MUs.Forklift.speed:=2;
3 _$ s! i+ o4 K6 K WH_var.delete({1,Part_Nums+1}..{*,*});/ o/ {( ^$ O# m& J& \
for i:=1 to Part_Nums loop" y) o t% Q* _+ S
WH_var[1,i]:=chr(64+i);1 L- }5 h5 O/ T2 ]3 U6 i* T! [
next;
$ J+ r8 C! F7 Y% vend;
1 Q. f! U6 u$ V6 Q8 p. v- d1 c出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 3 c8 P7 W0 v% n% J+ [
! \' y$ a) U% ~8 Q/ Q8 ~ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|