|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
* h( h7 h5 h4 S) ~语句是这样的
% p, Z- J4 Z! e# Zis9 Q9 [* d* y- x# u2 }
i:integer;
6 k# d9 A' i n* C2 U* | Res:string;! V& J. a0 i, a' R
obj:object;8 z9 q* j# Q5 L3 K0 B5 Y
do
7 n5 {' H% }% S$ [1 e' d if existsObject("Status") then( {6 i U8 ?0 b, d
Status.deleteObject;% _4 R# D( d8 S, W. d- g$ X
end;7 N' G' A2 e4 `+ W, P) [. f. }5 H
for i:=1 to 10 loop
( k. m: G$ u' Q% f! |# c6 A! O Res:=sprint("Store_",i);- A b5 X6 s0 i% V! k$ C5 ~; t+ M
if existsObject(Res) then4 l- L0 u7 ?! K
Obj:=str_to_obj(Res);& @# k: L# I# G5 V: a6 e& Y: g
Obj.deleteObject;$ ]% }8 Q2 z7 M k
end;
3 `$ m. Q) ^$ `; w1 ]8 Q next;
, v( ]+ `5 D8 J8 y- | --shengcheng Status:zimoxingceng5 ]- C' J' x) g" Y4 K: s6 w4 j- A
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
x" V# B) ]* }. e* n, v) x: \ Obj.Label:="warehouse status";
) U, _- V4 }9 G* w
% n' [2 \# R, }5 Y for i:=1 to WH_nums loop6 o9 R) t5 r0 M. f
Res:=sprint("Store_",i);
4 v' a; ~* d# t8 s c" O Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);- G9 z( a5 k4 P4 M0 ]( E
Obj.Label:=sprint("huojiaceng:",i);
8 x% `+ \3 |" X Obj.xDim:=WH_x;
& y% o. {) ~ N) g/ D1 N Obj.yDim:=WH_y;6 Q% z) X; |/ S
Res:=sprint("StoreData_",i);5 t4 f; w+ W6 j5 g
8 Y: z+ J+ V4 v4 H* m% U: T! V
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);/ t/ B; ], C3 V" C
Obj.Label:=sprint("huojiaceng:",i);
7 _. q9 k8 C6 e- ?8 g$ m Obj.inheritFormat:=false;- [- z, N, u p' ?; e" m$ X
Obj.maxxDim:=WH_x;4 {7 J9 L* E: i+ ~0 s& J( ]
Obj.maxyDim:=WH_y;
2 S5 F8 G, z' z& K1 K2 ? T4 V9 ^ Obj.ColumnWidth:=3;2 f: \ r# V+ ~4 Q$ o9 F, ?( R
next;
5 U- s$ v5 @0 y. W C1 z5 { ' [4 L8 [4 U" |9 l* ~. ^
.Delivery.MUs.Forklift.speed:=2;
& ~5 o6 y9 X( H# {& [0 N WH_var.delete({1,Part_Nums+1}..{*,*});+ a: {# D& A% C! e& G
for i:=1 to Part_Nums loop
$ f+ v: S& q# e( T8 @$ q+ n& a WH_var[1,i]:=chr(64+i);
# W: s& \$ X* s, a, }& e next;
3 U8 a) ?( M8 }6 S* v" Z+ ?end;
; T2 z; v- @) x- r4 t/ ]0 r. }出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 5 d, u5 o S4 C
6 W# I) U5 L! l% D
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|