设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4129|回复: 0

[求助] 仿真出错,求大神帮我看看哪里错了

[复制链接]
发表于 2015-5-10 17:46:09 | 显示全部楼层 |阅读模式
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。9 l4 W! i) Q1 Z$ F5 v/ w
语句是这样的
" ~* Y! r" \' d8 Ais
6 l9 p2 I- D! @0 z* g, R        i:integer;
% J( a3 Z4 r  Y1 Q( i' \. Z/ ~        Res:string;% e- Z; S( A2 d
        obj:object;
# f% o! N1 U3 z' G' wdo4 e* [; D  P" c; p. Z$ P- c
        if existsObject("Status") then! x1 F5 f: u9 f
                Status.deleteObject;
. [' |& v6 T* K9 s  Z3 s" V5 G        end;# f  D7 R9 M9 ?' }1 l  [
        for i:=1 to 10 loop, o4 _6 `* D) J$ B: c( K
                Res:=sprint("Store_",i);
  `: d) x3 V. \5 I                if existsObject(Res) then8 c# n' V$ Q& l% N0 y
                        Obj:=str_to_obj(Res);3 ^, J: _% E! B$ Q8 w
                        Obj.deleteObject;
8 U" z) o; g% P- b" W4 a                end;) F2 s' h' d3 `8 ]- p
        next;
$ @/ k) L% }6 w; M        --shengcheng Status:zimoxingceng$ l! u# V6 w! x: G! E
        Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");7 P: B2 X% ?$ P1 P
        Obj.Label:="warehouse status";
$ d/ Q& i0 g% `% [       
9 x8 i$ e; L" N! C        for i:=1 to WH_nums loop* `! R' c, W% ]9 j. @6 |2 M: e
                Res:=sprint("Store_",i);/ r) F% Q7 r. ~4 H; H4 Y
                Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);' J3 [4 w7 z  v( h6 x' z  k
                Obj.Label:=sprint("huojiaceng:",i);
2 [8 N8 d8 n( ]6 X( F" I% n- e                Obj.xDim:=WH_x;
# q5 J' ~4 s& u# W/ F8 J                Obj.yDim:=WH_y;
- f9 d0 R" T" E: j2 K                Res:=sprint("StoreData_",i);
2 Z9 @+ i) k9 `& t4 X* o/ S4 S4 T                $ o! {. }2 o  `8 U
                Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);: M* @# v' V' F2 M- S0 M6 W! y% J) t+ t
                Obj.Label:=sprint("huojiaceng:",i);
$ i5 d/ L) I2 @0 W. Z. s- T1 [7 x                Obj.inheritFormat:=false;
' R: Z7 B$ B8 O4 K" G" |                Obj.maxxDim:=WH_x;
+ N$ \( E& U" p9 o& ]$ Q                Obj.maxyDim:=WH_y;3 V7 {6 O/ ~5 u1 C8 n
                Obj.ColumnWidth:=3;
# g) s: P9 v; `/ M2 q        next;
0 u6 g/ ?% C& U9 i/ e% ]3 u/ }        : W: J, C& @6 W9 M' ~3 a) _+ @
        .Delivery.MUs.Forklift.speed:=2;# J4 O( B' O7 Y5 B8 y9 X
        WH_var.delete({1,Part_Nums+1}..{*,*});4 M6 K$ l$ j- s) d# t
        for i:=1 to Part_Nums loop
1 U( \4 f% J, ?) x8 g2 L                WH_var[1,i]:=chr(64+i);
. `) P! N: Z/ L  o4 \# Y# ]$ ^        next;# ?/ y, m1 ]2 \, }, [7 F: r; Y
end;( F9 V# s% R. |) K% I
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
7 o5 u) ~+ r& K# S5 p& k
8 c. q  J1 n0 ]2 o

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-6-25 11:31 , Processed in 0.015086 second(s), 17 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表