|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
& Y; G, B% z1 ^" E6 x+ B. A: O语句是这样的6 A' S. ^* j5 a c0 l+ Q5 c
is/ ~- H0 k* d# |% y3 H2 `1 s
i:integer;6 c$ R Q N) E
Res:string;* B& f0 `9 L, R3 }" G
obj:object;
& k2 ~% ` C a) O+ ]5 F" ]" Jdo
4 p' Y& `6 X: }( b6 x if existsObject("Status") then
! B, g5 w2 M% ]& j5 ^* e( H8 M Status.deleteObject;
5 L. S4 b$ M" { end;/ A+ g. F3 [: r
for i:=1 to 10 loop
# f0 d D' l7 b8 B$ ~. b; N Res:=sprint("Store_",i);) f' K9 m! [& O8 T- R2 L+ S4 c
if existsObject(Res) then
* Y) E( R9 h* L( Y' c! U2 \; @- | Obj:=str_to_obj(Res);
! B+ Q, o5 V% r: o/ O: k Obj.deleteObject;8 V c4 B1 O C* t/ t7 K6 `
end;9 E7 W, U" Z$ u$ V) ^( _
next;6 U3 ^; P8 z6 K% T& Z
--shengcheng Status:zimoxingceng
( e8 \7 j2 O7 f# S$ R Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");% l7 B2 C7 V8 t! j. a) e
Obj.Label:="warehouse status";
. B8 a: v7 e" c: I: ] 7 b! e- M' l% g# V% g& \: I: ^2 y" K
for i:=1 to WH_nums loop
$ I2 p& r, K/ m( w& ] Res:=sprint("Store_",i);
* \5 q) c+ B0 R4 s( B6 H Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
* N6 R$ K w% y+ [5 l4 g Obj.Label:=sprint("huojiaceng:",i);
8 i. t( H* T$ C' n2 e9 [0 j Obj.xDim:=WH_x;
" Z! S" Y9 e k+ T6 {9 R Obj.yDim:=WH_y;
7 W. u: H6 ~- ~7 V# } Res:=sprint("StoreData_",i);: L( P( E' z! w( Y
+ P+ X8 M6 j/ e) s! f& O W* i: b Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
! h4 |8 S# {6 K0 O Obj.Label:=sprint("huojiaceng:",i);
4 ^6 I# ~. t& Y% A9 y" g9 O Obj.inheritFormat:=false;) {: w8 z& b, w- g
Obj.maxxDim:=WH_x;
. }& q3 y/ V `+ }8 o Obj.maxyDim:=WH_y;' A* M3 n5 b9 \' X( E5 g3 c+ Q
Obj.ColumnWidth:=3;5 g) {; B; K' F" W; c0 c
next;
' Q! Q2 {+ @- r 9 d7 r8 z. B* [0 p3 ~1 e" y
.Delivery.MUs.Forklift.speed:=2;" w, W G* Y6 y' x) {( k* G, U
WH_var.delete({1,Part_Nums+1}..{*,*}); S& ]5 ]9 B1 `& y
for i:=1 to Part_Nums loop5 p. O& I3 \. I; @: W W1 E
WH_var[1,i]:=chr(64+i);; t3 S" @4 [. [9 ^8 x. k6 D$ K
next;
7 c7 P& x7 y4 D9 o7 w( pend; l" g- p* ?' x( Q5 {2 R" u
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 , t1 X# ?9 @( k6 H, G! @
$ R1 g/ V* C. e |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|