|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
0 p6 v! Y, I u4 E$ X% m6 x语句是这样的1 K, a5 V: o7 J4 ?& v1 J
is! D# Q: V" b4 U+ I& M& l6 \! l
i:integer;2 D6 x9 _0 ^; o! J
Res:string;
/ o% U# Q( |! J2 c; r( t obj:object;* v- p4 f% I" }, d/ _% M8 u7 ?
do7 L, l9 d* s' R0 k# H$ K2 i
if existsObject("Status") then d9 I1 L* Z" d
Status.deleteObject;& {8 i' s) J7 U+ q9 m4 g. L) e3 J
end;& d: e- ?4 [3 w- s: F. a7 I9 F
for i:=1 to 10 loop
5 P- V$ ^. R% L* ? Res:=sprint("Store_",i);# z7 e9 [1 \4 W1 E
if existsObject(Res) then
% y0 h1 p, @4 J Obj:=str_to_obj(Res);
$ V4 |" }; H# y+ D7 P% c6 P7 i6 c Obj.deleteObject;) a/ d1 c7 V# \
end;2 J: j: l4 B" U+ C
next;! f9 Q, _$ F* Z; e; `
--shengcheng Status:zimoxingceng3 [! F+ {% T% T: s8 {% A
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
4 T1 ]& l) L" ^ Obj.Label:="warehouse status";, B; D0 t- V8 l% s, h; [( z$ q2 ?
/ o. i# f" g/ H for i:=1 to WH_nums loop X3 C. O2 t4 {( E& e4 y* o
Res:=sprint("Store_",i);; T+ l. R% G. O: i9 A
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);2 e; B) c% ]& ]. N
Obj.Label:=sprint("huojiaceng:",i);. B n8 s" N- b6 a% H
Obj.xDim:=WH_x;
& q0 C) n5 M) {4 v: q2 [ Obj.yDim:=WH_y;5 X) h3 L" y. }1 Q
Res:=sprint("StoreData_",i);/ N8 f" m, u+ L# k) q
3 H/ c/ ^5 }! h8 Q" M7 i; b
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
! R+ c0 \# n6 V/ T: _! m3 \ Obj.Label:=sprint("huojiaceng:",i);2 ]- ^: K) q" [
Obj.inheritFormat:=false;
- ]7 R* h. x, n( s4 t3 g& `# ^, X' q Obj.maxxDim:=WH_x;! ]$ L: @) o$ W+ T* v
Obj.maxyDim:=WH_y;
/ b" ?6 b# a6 ]4 }' e6 K. w0 Q/ } Obj.ColumnWidth:=3;1 O1 A( R! @( U6 _
next;* i. [6 I/ L' M
: c) i+ s1 K! j* V# Z .Delivery.MUs.Forklift.speed:=2;/ z/ i9 `1 U5 l# n; H0 r
WH_var.delete({1,Part_Nums+1}..{*,*});
: X# z1 h/ T' q for i:=1 to Part_Nums loop
0 B% T8 o) L3 G' a; [( f, a WH_var[1,i]:=chr(64+i);
4 E8 d% Y+ A2 l3 s5 y; U* F next;+ I& Q+ {5 y' q! m) ^3 @4 W
end;1 y- D* I+ t! Q% o' K* o$ z
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 2 s, ?+ V- m7 b* {* N* Z6 w6 h
2 S+ Z+ I$ @8 P7 W/ E( w
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|