|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
7 l. S ]1 A l( f/ Y2 s' z/ c& s语句是这样的
+ R* `; M6 c s& R( x& s5 n2 Ais# l4 `) \# \7 k# Z, Z
i:integer;
3 z& c: S! i$ G Res:string;) v5 k+ t5 {+ H# W; i1 g
obj:object;
) a0 e5 G4 ~4 kdo
% H$ b5 S1 q# v3 l* @ if existsObject("Status") then" ^& L0 Z) ~% U
Status.deleteObject;* S' h1 s$ x, }& y3 a
end;8 d: y }$ O3 Z1 L$ Q
for i:=1 to 10 loop
3 n8 j: ]% G0 p) D Res:=sprint("Store_",i);% }: Y0 P$ d; n" j
if existsObject(Res) then
4 h% S& o7 ~$ X) D1 q* ^/ ^2 [ Obj:=str_to_obj(Res); U, ?6 b8 r0 @3 y
Obj.deleteObject;
* ~. f. ]( N, ?( M9 D) _ end;
/ T0 H" P1 ]+ k0 D. t next;. c$ w2 u: M, t. `4 P7 I* i" N3 \: ^
--shengcheng Status:zimoxingceng
- y& b1 Z, e9 V+ J( H! B/ f Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");$ r6 H. N/ V, s1 l; K6 S/ @
Obj.Label:="warehouse status";4 w) J1 z/ J- U: R+ }
, N1 b( D7 k- N9 f6 K0 u/ h4 ?3 z
for i:=1 to WH_nums loop3 E/ w" B. U5 r- Y8 v$ X9 o! X
Res:=sprint("Store_",i);
7 `* Q. q; K( ?# { Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
% g9 e+ U$ A7 b7 J Obj.Label:=sprint("huojiaceng:",i);
/ ^+ m3 q. B- T/ e* M; M Y/ }: X& P Obj.xDim:=WH_x;
8 M: N7 F$ J9 d0 e; \. N9 y+ n Obj.yDim:=WH_y;
2 I/ { X1 W$ Z2 Z Z. D- @ Res:=sprint("StoreData_",i);) u p* p9 L9 M; r( {/ q
5 k$ T$ |4 I- u. G4 r* [
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);9 ]7 {/ j8 d; y$ n; e- ?* D. H
Obj.Label:=sprint("huojiaceng:",i);
4 \8 q$ F5 h8 ^. n i. | Obj.inheritFormat:=false;3 c1 c8 L3 m- A
Obj.maxxDim:=WH_x;6 {* K" O: R" o* d; s5 y# t Z
Obj.maxyDim:=WH_y;# |* }/ K1 @! G0 W1 W. _
Obj.ColumnWidth:=3;
( O3 k+ ~1 e8 @ next;
8 N, r5 S0 v4 o* E% E1 K; D! {5 r & j& r+ U- ]$ {9 K3 b; k+ B8 h
.Delivery.MUs.Forklift.speed:=2;% k, k' l# `* x5 S
WH_var.delete({1,Part_Nums+1}..{*,*});
+ U" ~/ Z6 t: b( X; G) n# i% F for i:=1 to Part_Nums loop
7 w5 A* m& c9 Y9 e WH_var[1,i]:=chr(64+i); M- J0 ~8 G* p! I. y& m! @5 k3 [
next;: @4 {# U% Q& q8 i7 x# { j; G
end;
9 l/ t+ w! I! k% l+ f1 S出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
/ a' a0 G& c z) e/ i" w7 p# x3 \% i9 R6 B
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|