|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。4 ]$ B9 J6 K2 v' i
语句是这样的
" w" u% r$ I$ x+ ?5 d) Mis
* J! y! |! z9 _ i:integer;
0 v! m% c; X2 ^8 [) {; i Res:string;- K+ A9 K3 `' D: g# N, h
obj:object;
8 r3 T; u7 q; d! b3 Ddo8 m7 u* w' D9 x( i, i
if existsObject("Status") then
3 w$ U3 F7 ^$ o% i! r Status.deleteObject;" ?! l& ~5 W7 g: d) \- N
end;
. s. _1 x! B' \8 C9 K for i:=1 to 10 loop* l# y# |6 q7 F* m
Res:=sprint("Store_",i);
$ Z, t& V7 h- j1 ~" w if existsObject(Res) then
! v# q* E E1 ^$ P! B6 o/ T Obj:=str_to_obj(Res);* X+ z+ y- U; x" n" w/ a9 p
Obj.deleteObject;
Q V$ l+ N4 C' V end;2 a# ?. @/ Y! y
next;) f( R. U; y. p5 A
--shengcheng Status:zimoxingceng* [' `1 D+ g! V% f7 m2 G7 |0 z0 a
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
' M* s& c/ n4 e1 L5 Z! J Obj.Label:="warehouse status";
% H/ s6 d P8 K: [2 C( a2 {$ f1 O' d1 e
' H$ z4 x8 \9 ~" m; K8 y for i:=1 to WH_nums loop
( {; E: r1 s" B& K Res:=sprint("Store_",i);
# v3 \9 i- b3 O6 ? Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
0 j5 w" [+ [! z9 I6 h Obj.Label:=sprint("huojiaceng:",i);
7 e1 Q2 I4 |9 t5 z% |4 Z$ R Obj.xDim:=WH_x;* J6 F! E* V5 N6 N
Obj.yDim:=WH_y; ~, t% L3 n; g6 H0 m8 p: {/ r8 \
Res:=sprint("StoreData_",i);
. N7 P3 o' y T7 Q . u; V8 ^1 L0 m4 k9 q
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
) {0 }/ d; }& ?3 e" W Obj.Label:=sprint("huojiaceng:",i);
7 ^. q1 [: \, ?) x. R3 I- Y Obj.inheritFormat:=false;! z8 z; s8 x8 A
Obj.maxxDim:=WH_x;, [7 a/ X6 `8 B) F2 o
Obj.maxyDim:=WH_y;
# k7 Z' P/ l2 X& a, L5 Y Obj.ColumnWidth:=3; r% R1 o* ~+ ?! s2 k7 w
next;
3 ]9 v) ^0 A' o6 C8 X 7 q. M1 C- q0 L# N0 t' j! o }
.Delivery.MUs.Forklift.speed:=2;
6 r; \+ a; S2 Q WH_var.delete({1,Part_Nums+1}..{*,*});) `5 v* y* h0 z, D: Q3 a
for i:=1 to Part_Nums loop* i7 Z* l( W0 c S, y0 F/ i
WH_var[1,i]:=chr(64+i);: X0 ?1 V, @6 O% S" _
next;* o$ @! ]% w! @# g' ^
end;
D1 b8 R) C; E( K出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
7 U. m8 J- V: L. @, s- T$ W/ s6 M% N# \
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|