|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
1 q# i4 U0 y' ^9 E* q* U. L语句是这样的2 G7 F A0 n. o6 w- ]
is/ U% S; U% O% k& [; e
i:integer;
1 c2 _! C! v% w9 j3 e Res:string;
" |5 Q9 f. e* r" ^$ W0 [ P obj:object;
7 A/ G) ]8 z& O6 V9 Tdo
2 S* {8 g( w& I( c4 P- Q+ \/ O. A if existsObject("Status") then
. a. z, x4 k" \! g: @. H Status.deleteObject;
# V& e8 j; d& y6 ]8 Y end;
/ |1 m% ^" R# a( K for i:=1 to 10 loop6 f' K- v! U. c! t( v
Res:=sprint("Store_",i);6 Y8 n- l3 ]+ i% N% g$ `" ?6 u
if existsObject(Res) then- @8 h# N6 G3 T* l2 Q
Obj:=str_to_obj(Res);0 h0 Q' b7 S+ R7 F! i2 q& O
Obj.deleteObject;# r- L' r% E# ^/ w; A
end;2 F$ K8 E$ k4 j
next;2 `9 Q; t* B7 \+ s$ V5 ^
--shengcheng Status:zimoxingceng
+ }$ x4 Q9 I/ R- F3 X- l Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
' p( n- B) X V2 ?9 H: I3 G Obj.Label:="warehouse status";+ V! c) {" W4 ^+ |3 Z1 G
7 G1 r' g( j' l1 C6 p: T9 H4 o for i:=1 to WH_nums loop
7 l2 s( @! c! W- Q' G" M; k Res:=sprint("Store_",i);
/ q3 W, v( N% s, P4 I Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);% G- i) n+ r1 R$ u/ N; H2 O9 y
Obj.Label:=sprint("huojiaceng:",i);
4 Y) Q: R+ M( W Obj.xDim:=WH_x;* a& e! f! }/ F9 ^) {& S, O) A
Obj.yDim:=WH_y;. H# W1 N) }& g: H/ s
Res:=sprint("StoreData_",i);3 O# F& p& a( o/ H6 [% V2 C5 Q
" c- t/ N' y( I Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);- u; d( r! o3 `4 {
Obj.Label:=sprint("huojiaceng:",i);
5 w2 u8 u. I6 C- J& M Obj.inheritFormat:=false;! p! y a3 u2 @+ C7 f
Obj.maxxDim:=WH_x;
% o9 }/ d' v4 u4 L! z8 s9 p) V Obj.maxyDim:=WH_y;
% b) b1 O% ?" F7 z7 N- } Obj.ColumnWidth:=3;- W. H6 Z9 B1 M* c3 Y5 f& Z
next;
^4 p% j* M7 u0 W8 w4 V0 E/ m
0 l8 ~) ~$ N9 }7 h5 h" t6 D' }- g .Delivery.MUs.Forklift.speed:=2;: u" L5 a5 O5 G
WH_var.delete({1,Part_Nums+1}..{*,*});9 H1 b. N7 D: s
for i:=1 to Part_Nums loop
5 ^0 }# u1 i1 a" i& {! I5 d WH_var[1,i]:=chr(64+i);
: j! `6 x4 F* h1 m3 H& k5 e next;
4 R& T* w. c5 A+ Q4 l2 h% Eend;
" k6 ^/ N" j# n2 f" _出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 c6 `0 B t- ?7 C3 V$ p2 `& S' M
/ N: t# r( j* H6 F! ^% j1 K8 }+ _# g
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|