|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。, }2 m( ?+ x2 d* a) c1 }6 s; u4 {" {
语句是这样的
9 ?9 q, v6 W% eis
* w2 o: D, Q" g% @' \; r i:integer;
7 l$ i V' w' i- t' A7 G Res:string;
" j5 w" E2 q6 s obj:object;
' ]% F/ ~+ c: [) V: m& Jdo+ n) R1 w7 Z. N% |
if existsObject("Status") then
. D$ S* G: ~# U3 k. ~6 G1 ] Status.deleteObject;
( \9 [0 d1 y, E2 a# j! j" B end;$ A, E" h3 Y- r- ], i- N% V
for i:=1 to 10 loop
# }5 S( h: a$ b$ T/ x. |$ l$ S8 A Res:=sprint("Store_",i);$ O1 P7 Z" F! k0 B; I9 R
if existsObject(Res) then; H- a3 F, N, ^8 K+ F% n& g
Obj:=str_to_obj(Res);2 Y _) z& C2 k4 d/ L9 a
Obj.deleteObject;
" W( X- L/ {! B- j2 h end;
8 F% ?/ M' L8 i9 q2 @1 ]9 [/ B9 J next;6 q; p4 V- q! ?
--shengcheng Status:zimoxingceng
4 r! a' I( z+ f9 B0 V/ ]- p% J4 Y. O Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
! j0 V! u9 ?+ s8 Z- o& L Obj.Label:="warehouse status";; h1 K3 F# l" f; L; M. F
6 r/ \! p/ u2 ~6 p( b for i:=1 to WH_nums loop, y, h/ ~. H% I w) g2 D8 ]6 p
Res:=sprint("Store_",i);8 b/ c& G6 R. M
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);6 h9 n0 }4 p6 o6 i: g
Obj.Label:=sprint("huojiaceng:",i); Z& e. d0 Y) s5 c7 Q
Obj.xDim:=WH_x;' T \ Q; U5 ?
Obj.yDim:=WH_y;
; y( p5 [; A. r" f8 ]+ k N; r Res:=sprint("StoreData_",i);
! Z8 }7 b# v! }1 X4 J A9 u , p- d+ U0 Y: ? \2 K, C
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);9 Z, f. c$ t9 ~8 v* k
Obj.Label:=sprint("huojiaceng:",i);
& d2 n" y& D8 R$ \ Obj.inheritFormat:=false;
9 S$ Z# u, i4 P1 r! B Obj.maxxDim:=WH_x;8 }9 z. }$ S$ z$ j$ d/ Y5 v, H! L
Obj.maxyDim:=WH_y;& N% a* e6 J, w6 M+ Z
Obj.ColumnWidth:=3;
5 b9 v3 W r5 G! w6 N( f' T# y next;
7 Y [8 M$ Y; Y8 f& u4 q, _8 R
/ t2 O' N" ~" @/ F5 Y: | .Delivery.MUs.Forklift.speed:=2;3 U" l5 b5 Y( h! m5 o4 g
WH_var.delete({1,Part_Nums+1}..{*,*});
/ A( l% v6 I7 k% z: O for i:=1 to Part_Nums loop0 r+ s2 s" `2 G& T
WH_var[1,i]:=chr(64+i);+ p3 Q! I+ G l
next;
9 W" f, _# C8 \- O9 gend;& G4 H" [4 ^( H0 x3 T1 b
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 & {, i8 w! u4 t0 [
& ^3 z9 x$ i" k _( C6 M |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|