|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。: W/ q# J8 e4 k
语句是这样的% @% L/ T. I5 ?, a
is) h* d2 Z( `3 M8 v/ W8 g, t- @
i:integer;
: T% m( e. m `* f' U Res:string;
9 P8 C6 q2 M6 y* y0 g- U# ]- p! p obj:object;- e" t3 F$ u4 _# _) K
do
; u. u9 h! g* g- w if existsObject("Status") then& `- L. y' s" R4 |
Status.deleteObject;/ `5 E* i$ G+ u& Z! F: ?1 w
end;% T9 s7 n: F' {6 q$ V$ e" w& y
for i:=1 to 10 loop# G% G& x+ M$ R! Z6 z9 D! c6 o$ c
Res:=sprint("Store_",i);# S' k# b F! ~5 c& X
if existsObject(Res) then
0 N! G% C8 M7 N/ X Obj:=str_to_obj(Res);
# _. ]! A2 ]2 _: `0 H Obj.deleteObject;
# X; L$ Q7 a% w) V' b$ V# s end;8 R$ @& d; Z" \. g' q/ L
next;
( r6 F4 `0 l. K; n) B* F --shengcheng Status:zimoxingceng" w" r' H" S% ?" }& v& B) ?
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");! y5 d: Q1 n; R1 h- G. ]
Obj.Label:="warehouse status";5 [! E1 A7 B" V2 D- w5 {
6 \8 d$ E- ]2 o, M
for i:=1 to WH_nums loop) g0 \9 l( C! `. s9 g
Res:=sprint("Store_",i);- k1 P! V5 b! m
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
/ h( E" V/ n! Q& V1 ^+ w- b1 }) P5 K Obj.Label:=sprint("huojiaceng:",i);) P* W" Q9 F" }! O7 `( x. o
Obj.xDim:=WH_x;! i. [+ W/ N k) k# u
Obj.yDim:=WH_y;! K" g3 g% z* k9 V' I' o% `! y
Res:=sprint("StoreData_",i);
4 U# N ~3 } O. L+ R# O
3 T2 `: N3 s+ R1 |3 u4 E Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);2 \9 |( h* H$ x3 i8 a& {) Y
Obj.Label:=sprint("huojiaceng:",i);0 w! R* t9 _3 L9 R4 U( f
Obj.inheritFormat:=false;
# t2 J' ?8 ^2 Y7 Z Obj.maxxDim:=WH_x;
0 V$ j8 e7 ^" m# X. ^0 n Obj.maxyDim:=WH_y;
) ^! F: e }+ ? Obj.ColumnWidth:=3;; W6 o/ ^& [: l8 {8 f( T
next;
1 l' B7 L* E/ }# O# X' R7 d8 k ! d# [$ U5 O8 h, I! T" H* C
.Delivery.MUs.Forklift.speed:=2;& `/ d7 a* k# u5 y
WH_var.delete({1,Part_Nums+1}..{*,*});5 y1 F9 o6 K, {8 G+ F6 H
for i:=1 to Part_Nums loop
& {+ |0 _/ E2 \: M WH_var[1,i]:=chr(64+i);
, U4 T3 | l' g3 p next;
* w. s- d& c {8 aend;( [9 D2 t. X/ Y
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 " j5 T, S9 a3 L* n
: q' c ]9 P% H* N/ R
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|