|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
* K# k- N; g0 Y; V& Y语句是这样的
- r2 R) z% W- f: k: H6 qis2 H H0 t3 D$ _ I M! }% M- V0 `
i:integer;
2 G, y% I8 {: B# I& \; }+ B' J: z& T Res:string;! c. N ?9 R- T7 V
obj:object;
6 O- i. ? L) E. k& J. bdo8 W8 P* H! ~: Z& j
if existsObject("Status") then0 u; z. O& W7 J# G# g
Status.deleteObject;
5 B n* L. A6 V$ R$ E: V3 n- Z end;
. I% X) J6 O+ Y4 w& B& q1 O8 s for i:=1 to 10 loop
3 q8 u$ `' e* o9 K- R Res:=sprint("Store_",i);
, A2 g4 \; g9 X) d8 [" g if existsObject(Res) then- `+ Z4 _) R$ a# R* E
Obj:=str_to_obj(Res);- [) E8 i) u3 i# f2 W, f( {
Obj.deleteObject;8 Q( G7 D8 C' G# c& M
end;
8 j: f M( o0 N2 L next;3 r( a8 c5 ^9 P! u
--shengcheng Status:zimoxingceng/ J5 |2 V& |6 @
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");" B% Z% F9 x+ @1 D9 r
Obj.Label:="warehouse status";% \8 y7 K# F. ?9 k6 A1 I1 ~. [
/ x' Y! V/ {* |1 k. x9 d1 z" W. E
for i:=1 to WH_nums loop) _# o ?' W& r* e& S5 T+ v
Res:=sprint("Store_",i);
, e+ `' q9 {1 | T6 z Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);; Z' ^0 ]4 K" a* M7 A5 I* O8 p
Obj.Label:=sprint("huojiaceng:",i);
- s. m5 v" L+ x. \: w6 k, ? Obj.xDim:=WH_x;0 j( X' E. S# s
Obj.yDim:=WH_y;) t, i3 _: a! Z$ N8 H, p
Res:=sprint("StoreData_",i);
0 c$ K. h- A# q9 Y) ^; |# Y 1 f G% [ R, `7 @
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);) E+ k/ T) n$ y2 g: u1 u/ z+ b
Obj.Label:=sprint("huojiaceng:",i);: B4 s# D/ U( H9 w) B2 }. A0 V
Obj.inheritFormat:=false;
+ t+ {% Y# ~$ ^- V' g' g' D Obj.maxxDim:=WH_x;
Z: w7 ?" N8 _" f4 a0 {% W Obj.maxyDim:=WH_y;
* B6 K8 `2 J9 b' v Obj.ColumnWidth:=3;
5 U6 }8 K. N4 E9 x next;) F U9 s a% N, @, X \
" ]2 f5 i1 V# z7 x
.Delivery.MUs.Forklift.speed:=2;
; l8 l: d% V, C3 J: C WH_var.delete({1,Part_Nums+1}..{*,*});
3 E2 C, ~2 T; A/ n5 n for i:=1 to Part_Nums loop
( Y$ c' a! j/ t0 B! Z0 j, A WH_var[1,i]:=chr(64+i);5 j9 E! K4 a4 f4 q+ Q& l) J9 B
next;4 a4 B; \/ N( i$ j* C1 o. O& ~
end;( r1 U, D2 l: L2 ~
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ' p+ g! P8 x. A! G3 f2 U0 @; g
, V) i! T. m+ n o' [ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|