|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
% m# U% r( b3 G/ z; r4 N语句是这样的
^8 \; s' S! \% [: _is+ l' D( O8 n7 I
i:integer;# ?3 ^5 |% r3 p z- o; `
Res:string;8 P+ i1 l/ o! X
obj:object;
* p; m% N9 N0 _1 l+ O9 I7 Pdo
' {) b( f" Z1 V2 Z# ~ if existsObject("Status") then1 b. D9 z; `$ X$ }1 R5 o3 W! j
Status.deleteObject;- m3 ~! \; A7 @
end;) ]$ d7 P. f, U5 Y( B
for i:=1 to 10 loop
8 I3 e6 X$ @% @ d; h. D$ _$ [: w Res:=sprint("Store_",i);1 w- j( }. ^' |
if existsObject(Res) then
' w. a4 \4 s, q5 R) O, D1 R Obj:=str_to_obj(Res);0 d/ D% ~+ Y- }" f4 ~# J
Obj.deleteObject;
8 H6 H! Q Y2 f+ Z8 ?) k end;' G6 r: c/ A1 K7 P- P, Q: G" a4 c
next;
8 {7 A3 V! Y# @# O" e --shengcheng Status:zimoxingceng
/ S; R) `. w& K: u: Q Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");1 p. A7 W6 i& v- s; r
Obj.Label:="warehouse status"; d7 Y! i, D ?. \
+ ?! q0 G m! x6 e# T& V' d, z
for i:=1 to WH_nums loop
# |0 ?. T( N! F; n8 p- r* m Res:=sprint("Store_",i);* q0 _. ^ j% d
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);$ \1 Y6 U0 ?0 U# o4 l0 D
Obj.Label:=sprint("huojiaceng:",i);
( y7 A! h3 v" Z2 r$ x, F6 y Obj.xDim:=WH_x;
+ P1 P( y% Y6 p6 M+ t( y# _( l Obj.yDim:=WH_y;: G, Q. M. d4 K/ V
Res:=sprint("StoreData_",i);8 J# Y7 V4 i5 D/ M* e5 e ^, ~
& c6 T9 W* C' k9 i7 g8 m
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
1 y* O% f8 O8 {0 m! @/ S Obj.Label:=sprint("huojiaceng:",i);4 U' t6 q' k! ^- T
Obj.inheritFormat:=false;
! ]+ z$ Z+ {2 f7 q7 n2 h& ^ Obj.maxxDim:=WH_x;
b! J3 Y/ b3 M$ R) A9 u Obj.maxyDim:=WH_y;$ `7 w" y2 j8 N' d! Y B) g
Obj.ColumnWidth:=3;
7 T4 V5 @$ I$ a2 F next;1 M8 u: _% K- m( P
{* @- G: k1 w9 P' w4 ? .Delivery.MUs.Forklift.speed:=2;
# t! j5 f' F! C' {# P" G WH_var.delete({1,Part_Nums+1}..{*,*});
& f; K! b( s9 ]! Q3 ?) G5 J8 ` for i:=1 to Part_Nums loop
. r4 E" B) l7 w' E5 _ WH_var[1,i]:=chr(64+i);6 V2 M* J' \5 U
next;. r, M7 s6 m% r( M$ F% f$ t
end;# }9 G( Y9 W2 w& z$ E
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
; s6 S2 w! g1 E; d1 o% }7 `0 @* E0 X$ N& `& h0 W* z; Z# ?
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|