|  | 
 
| 我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。 9 u3 P* b5 y2 O' d" `语句是这样的6 n5 ?% h7 i" l9 V
 is
 ) j# V0 h) m* ?/ f! f' [* G        i:integer;$ Q7 v- Q8 `' R* v
 Res:string;
 : C. O2 ?! v5 q: U0 d        obj:object;7 F, a: w1 h8 U% W% A
 do4 V+ g8 h6 m4 z% |: `4 ^1 c: E
 if existsObject("Status") then
 ( h$ z7 s; u, Y5 i                Status.deleteObject;
 7 Y' ~5 D6 \  T/ Z* @        end;
 : f( O* R8 P* w% q        for i:=1 to 10 loop0 \2 d( L4 b  f( x! i
 Res:=sprint("Store_",i);. c, h% Y. U) H+ ?* y7 E, u& `& C
 if existsObject(Res) then
 : O% {1 ^9 h# T                        Obj:=str_to_obj(Res);9 `6 V1 Z5 F6 I" u8 ]- y% L
 Obj.deleteObject;# \6 G+ L) [' W, A
 end;
 ) p- K' F. o, c( h( g6 X        next;) ]2 T4 O3 i* J, f
 --shengcheng Status:zimoxingceng" T2 c4 M9 |# r
 Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");( M$ y, n6 A$ ?7 r  F4 l+ v
 Obj.Label:="warehouse status";
 1 \- b/ S: x$ J. y3 U
 ) l0 ^4 o' `% ]8 e8 U7 P4 X3 [        for i:=1 to WH_nums loop, @1 Q- q; N; b4 ?: o
 Res:=sprint("Store_",i);
 / A2 B- E# [7 N% s0 Q9 o% R                Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);5 s. w6 p# W( f6 C% T7 k4 p6 \
 Obj.Label:=sprint("huojiaceng:",i);
 s9 X! Y, y2 L) p; \: Q                Obj.xDim:=WH_x;
 # y& W0 m( h; i5 m2 T                Obj.yDim:=WH_y;! K  [1 M: M5 s0 D. K. T- n8 I
 Res:=sprint("StoreData_",i);: F: j3 ]' {. ]2 t* a3 v
 * Y  t1 r7 N, d( @4 ^# C3 e
 Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);! M/ N" P2 ~6 k
 Obj.Label:=sprint("huojiaceng:",i);
 0 i7 i" }& T) N! P                Obj.inheritFormat:=false;
 + j* D  ]* {" ^" X/ \                Obj.maxxDim:=WH_x;
 / e/ ]+ G0 I2 Z) U* M0 v3 U                Obj.maxyDim:=WH_y;
 ! @/ S6 e: y( H( j/ z                Obj.ColumnWidth:=3;
 % {. d( p3 i; \) Y4 S        next;
 p8 r8 _& ]  o1 I+ h& p5 ?        9 S! i2 w# Y, o' G4 k: d6 m5 y1 I
 .Delivery.MUs.Forklift.speed:=2;: ?, V  ^4 t# t
 WH_var.delete({1,Part_Nums+1}..{*,*});
 * n, M' ^- P3 U# {0 ^0 {        for i:=1 to Part_Nums loop
 - I9 O* V1 w" n: T0 |                WH_var[1,i]:=chr(64+i);  b2 X9 q% t/ h% z0 g" K! t4 V3 \' p
 next;
 , z. s5 y1 F: ~* W. G8 U. Bend;% P, e1 X/ g) i* I  D3 ?' }
 出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
  ) U# Q% x( w: T* m 
 ( S5 U# B& C) ?6 ~
 | 
 
x本帖子中包含更多资源您需要 登录 才可以下载或查看,没有帐号?注册 
  |