设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3876|回复: 0

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

[复制链接]
发表于 2015-5-10 17:46:09 | 显示全部楼层 |阅读模式
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。: e& J9 W) N5 n9 F
语句是这样的
1 c/ F5 ~* G; Y) ris  B7 n( P, \! p/ n# i3 r$ j" k
        i:integer;
" i6 C; U+ B8 ~        Res:string;
9 Y3 h, U2 K3 r" o        obj:object;
+ _1 X& u- [# t1 g8 rdo
# @: F0 y: q- [) U9 L+ f- j& B! g        if existsObject("Status") then1 [9 [/ k" }; P+ L3 Y8 k
                Status.deleteObject;  g* E/ r6 D/ Q' q- E
        end;& U: X% ^( D: R6 G* M& g8 ^" [3 R
        for i:=1 to 10 loop, G+ d5 G8 n: Z- h" H0 C
                Res:=sprint("Store_",i);
% q2 _8 o) p( u                if existsObject(Res) then4 B5 }" S4 r# X2 c7 }( x3 R2 Z
                        Obj:=str_to_obj(Res);
% f' ?/ r6 P- R9 [! C5 H                        Obj.deleteObject;
( D, r+ P: v8 `% b6 O                end;
4 P& r  D. ~- M# Q        next;
6 I( I( P2 s% v0 Z4 d  s8 x' {        --shengcheng Status:zimoxingceng
- k! x- e7 Q( e6 }- x& h        Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");4 e3 j: v1 P7 M4 I1 Y% t3 }
        Obj.Label:="warehouse status";
3 m. P- O, D+ H2 t7 P. i1 H  d       
4 s3 s" _# A4 v/ N9 ]- v2 }        for i:=1 to WH_nums loop
$ L% N3 G) `' r6 q0 }* g                Res:=sprint("Store_",i);
9 R7 b& d% X' h& e! C2 k                Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
: Z. f/ i- w9 |' ^$ x" T2 W                Obj.Label:=sprint("huojiaceng:",i);
& A9 C0 r7 M+ ~/ q7 i                Obj.xDim:=WH_x;2 N9 i3 S. u0 N% {9 A
                Obj.yDim:=WH_y;- S3 l& ~/ C# f$ \# \; s' K
                Res:=sprint("StoreData_",i);
, t9 @8 `; R: Z* t! k               
( q! h  F( u1 Y$ A2 q; P                Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
5 N$ b6 v0 y3 C+ M" G! X' K+ F                Obj.Label:=sprint("huojiaceng:",i);. _* T2 k2 y5 _, V/ ^) l# s' R% k
                Obj.inheritFormat:=false;0 T! |4 V% {' o) B8 ^+ V. `8 \
                Obj.maxxDim:=WH_x;1 {0 q: h* W1 d) s) U: F* k( g
                Obj.maxyDim:=WH_y;
  h0 E4 x& L' N  \                Obj.ColumnWidth:=3;+ W' {8 _$ f8 T" `5 T8 F9 S
        next;
" w/ G# P3 [1 L" H9 q+ _       
# M$ t6 x" r% @; J6 D& @6 B        .Delivery.MUs.Forklift.speed:=2;* \3 X) @. l# }0 D4 x1 O
        WH_var.delete({1,Part_Nums+1}..{*,*});; j9 }9 S- l. d/ |- i
        for i:=1 to Part_Nums loop
5 q/ y* S: V2 q$ p                WH_var[1,i]:=chr(64+i);
( _9 X6 |. x3 T! b: \; Z        next;% O9 t4 D2 y4 ]* z. K( g! S
end;& [/ {& o0 X" T, K2 O
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了( f; i  ~5 i2 |% D4 }8 V

( K" z$ h9 b; x" E( P

本帖子中包含更多资源

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

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

本版积分规则

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

GMT+8, 2026-5-9 00:31 , Processed in 0.024311 second(s), 17 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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