|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
7 A$ X1 D5 j- } l语句是这样的
8 ~/ h+ j, R8 D. {is( L1 }% ~+ C+ l; ?. B* L
i:integer;# S7 I( q& e+ u1 ?( [- v7 P
Res:string;2 h+ N8 ^. i; @6 @; m
obj:object;' I- V+ U L N7 v! G. t) x7 C
do
; H& Y3 t: P& V7 X! z9 S0 C if existsObject("Status") then, \" t; T) G+ H( _ @( p
Status.deleteObject;
" i$ A; {- D% [% \ end;. ` C! R4 U5 Q5 Q3 M
for i:=1 to 10 loop
, {- \) s" c4 V) f$ ]4 M1 F2 @4 o Res:=sprint("Store_",i);8 j6 g- B& J9 M9 q4 f
if existsObject(Res) then
- u' b, _4 U1 {3 m' @ I Obj:=str_to_obj(Res);
) B0 z1 T$ d. e7 {" f4 `# { Obj.deleteObject;
. B( [$ W% A1 a8 z1 _ end;" T* k+ E$ \7 y% j7 ~+ W* O
next;% E: G1 x3 d; K: G
--shengcheng Status:zimoxingceng+ ^( m. q4 K& U. b+ K
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");7 f2 t% }; Z; _8 i# a
Obj.Label:="warehouse status";( J+ c1 r5 n' u# e N) F( c
9 o" j: U+ J, u7 d: W
for i:=1 to WH_nums loop& l* ^' d: Z3 S8 q" M
Res:=sprint("Store_",i);
- |0 s7 x* \1 i3 I Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);8 h" H6 }2 H8 S! y
Obj.Label:=sprint("huojiaceng:",i);# W& ~4 |+ X$ s$ D* A7 D4 x. V; {
Obj.xDim:=WH_x;; a: c' D# W+ f$ l
Obj.yDim:=WH_y;5 v2 W! L- I+ T7 M) D9 |
Res:=sprint("StoreData_",i);
" B3 B. n4 c7 |7 I+ B& }7 T
* i/ B4 ` U8 d1 o, @ Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);* O6 R! j+ p! j; H) N' b
Obj.Label:=sprint("huojiaceng:",i);
+ P6 R- M0 x2 A; \ I- r3 N Obj.inheritFormat:=false;* A* f3 `- K3 |1 M
Obj.maxxDim:=WH_x;1 L V* B& x( X
Obj.maxyDim:=WH_y;0 J# I# C: p' E" Q# Q
Obj.ColumnWidth:=3;
L: Z/ B/ _4 D. ~. L next; ]# q% b( _ A1 P! }! x7 q
( a- v; {/ _3 b
.Delivery.MUs.Forklift.speed:=2;+ r, ^) v% d! H# ` O
WH_var.delete({1,Part_Nums+1}..{*,*});. S* t4 w4 y$ N) {0 E" ?
for i:=1 to Part_Nums loop
: L+ I" t7 x8 a9 C& A: s+ E WH_var[1,i]:=chr(64+i); H x2 c' F# e' J. _
next;
) `0 d/ ^% H* y+ H1 R% L+ iend;, n1 D m! @, |# ^
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 l% f: l7 Z* |% Y5 |6 a+ f
# G- m' A: g. t6 k2 _2 Z8 X |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|