|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
; s) m. o* }( g语句是这样的
* P% `- S' ~+ S E' Cis6 ^! v/ {! Z! V
i:integer;3 Q3 b: J$ [4 r* C# H" X5 n( J1 k. B
Res:string;
; \9 i2 L- y, T0 `) c1 x, _ obj:object;
- m+ Z7 N& s# H: }; `do( s- Z- j# [2 w6 Y/ _2 M! E; i
if existsObject("Status") then- ^4 ^3 V* i- u4 f0 B) G
Status.deleteObject;
# F j3 P5 L) b8 [' Z1 X end;$ ?, e! [6 p& c+ W2 U4 A
for i:=1 to 10 loop
. B: v/ i0 q h Res:=sprint("Store_",i);# z' S# B5 M0 l1 n9 l w& ?' Q
if existsObject(Res) then1 f# j) V" z6 q* L+ P
Obj:=str_to_obj(Res);, O& d, S$ M8 E/ `: L" Q( t
Obj.deleteObject;
/ \( I. S' R* b* D' o5 q end;7 g) b* J2 p% t e; Z; W: y0 n0 q
next;6 X2 m* s; A$ h, ]) J; X, z, [; ^
--shengcheng Status:zimoxingceng) ?! v9 n6 O; Q' `4 p; K
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");6 F* w1 j" E A: r% F+ y1 m p
Obj.Label:="warehouse status";
$ U$ L; s+ N: G \: G z# F( K9 |8 I * V) I6 U- C! \: `3 {6 o$ o. g1 W; n
for i:=1 to WH_nums loop% ]- m3 A& y" n1 ~2 L
Res:=sprint("Store_",i);
( y L3 X' ?; o% R Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
5 ]% [: H/ m& C( U Obj.Label:=sprint("huojiaceng:",i);/ P" I e1 V/ A2 g
Obj.xDim:=WH_x;/ W; N( U# e b2 n/ J, R8 m' k
Obj.yDim:=WH_y;
$ E6 H% u, \: i% \" p; Q& m Res:=sprint("StoreData_",i);8 `* d4 i: s4 H& X4 Q0 G% {
$ ^% I5 O: [% z" ?/ [# T: M% P Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);0 J, Q% q! H0 J' N
Obj.Label:=sprint("huojiaceng:",i);# k+ K3 g5 \& u2 {2 ~- d( O3 Y
Obj.inheritFormat:=false;2 A$ f: I. i8 I
Obj.maxxDim:=WH_x;
5 r2 ~1 z8 W6 Z" ]* c* r( }, j$ l Obj.maxyDim:=WH_y;
( X9 J1 L8 n* `6 E2 \6 L Obj.ColumnWidth:=3;. k7 s( w) d, i. X
next;
' c& W Y5 b' F- h! H; t
8 [: ^( h% z8 ]: u8 m .Delivery.MUs.Forklift.speed:=2;0 p% y0 {& @. p# Z4 E3 l/ l3 `
WH_var.delete({1,Part_Nums+1}..{*,*});' x8 m) [5 x1 ~- Y$ A j& X9 y
for i:=1 to Part_Nums loop! Z0 b( |$ V# J x
WH_var[1,i]:=chr(64+i);. i4 X0 v* |% ?3 E7 ~: \
next;
' F2 L2 p" B$ _# ^& t0 ]end;7 R ]4 q7 ^8 T( v" T9 f
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
! B, x' @! s% t p' C; S
' I- A. U3 }) P0 z: Q/ [ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|