设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4271|回复: 0

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

[复制链接]
发表于 2015-5-10 17:46:09 | 显示全部楼层 |阅读模式
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。7 i! R. P3 |! \( k# F9 r+ y* O& M7 t
语句是这样的
2 |) t3 k$ T# Y7 k1 y3 zis6 X! s3 E5 m; H4 A. z% f& K
        i:integer;4 C) ~  Y+ d( p; @. x" R
        Res:string;
1 T0 f8 I) @7 f5 v% B* v! S        obj:object;
% G/ |+ H$ y9 H; ado
/ m# ~! ~7 ^# d, k7 ^1 E4 C        if existsObject("Status") then* E; `3 X8 L9 C" N1 f
                Status.deleteObject;
9 B2 ^( Q" C) \5 B, {( ~        end;% p9 T1 x) y- i/ |; s8 r" @* Q
        for i:=1 to 10 loop
) e: J) P$ G% R" ?6 X                Res:=sprint("Store_",i);4 G( A0 f+ l. _) |
                if existsObject(Res) then
+ }# Y: g8 @8 A* A8 ^0 H3 m* z, g                        Obj:=str_to_obj(Res);
3 o! a% l' R) q0 @; _                        Obj.deleteObject;1 T4 G5 _, w% d8 J
                end;# \* W. |. `; m* f& P
        next;% R/ P; d$ @) R$ J, F
        --shengcheng Status:zimoxingceng! W+ ^. w, K' U4 q, j+ i( ]$ Z9 V
        Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
# T1 m7 E5 X  c# V) v6 ]        Obj.Label:="warehouse status";
2 x  b3 Y' Z1 u4 p5 g& T7 m1 L       
" s% [# k- H4 Z9 q7 R: L        for i:=1 to WH_nums loop; F3 m& Z/ ^" j# y/ `
                Res:=sprint("Store_",i);
1 e# y; |, [0 H1 q* X5 W                Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
5 m* t1 F& C4 S6 W5 [1 J, }- p                Obj.Label:=sprint("huojiaceng:",i);
) }* p; h% c& q8 _2 ~                Obj.xDim:=WH_x;
3 ~4 t, a5 B1 \                Obj.yDim:=WH_y;0 `/ r5 W# z1 C+ ^' c# k" x  q/ {
                Res:=sprint("StoreData_",i);- ?" {, n- W+ [8 f! V" q4 z
                ( q, O! M0 o2 j" \
                Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
6 V/ d# `4 J/ U% @/ Z, H' T0 N                Obj.Label:=sprint("huojiaceng:",i);
7 b  \" o# a% p# [% T                Obj.inheritFormat:=false;; N( n$ y: `: s
                Obj.maxxDim:=WH_x;
7 \, I8 [' K0 G9 ]5 b$ ?& u                Obj.maxyDim:=WH_y;7 A: J: P+ k, N& x4 `$ ?8 r- {( j
                Obj.ColumnWidth:=3;( T1 |2 d) c9 ~( V+ W# B) H$ o4 Z
        next;  N+ b; }- i. U  a8 X
        ' n% g' {! Y2 }9 h0 I" U' E
        .Delivery.MUs.Forklift.speed:=2;+ P3 @) u5 s  d' |; x
        WH_var.delete({1,Part_Nums+1}..{*,*});' q: A; B) W: J  L
        for i:=1 to Part_Nums loop
5 N4 J$ Y6 |0 e# F6 o                WH_var[1,i]:=chr(64+i);
$ U& w' N4 n1 o) \2 A9 Q' V3 W# Z        next;
4 x$ e  Z) E0 Q4 Kend;6 v" i* u# K- t/ |
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
' L) L, P+ u; Y- K, f# }/ ^" E6 S8 @1 g+ L, x' z, D5 I4 K

本帖子中包含更多资源

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

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

本版积分规则

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

GMT+8, 2026-7-17 07:44 , Processed in 0.013693 second(s), 17 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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