|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
( F1 ?- _- I& S0 S# a) z语句是这样的
0 [" y$ u( u1 B& X( |% ]is
$ {/ _. U2 u! X5 [9 ]! O* v i:integer;6 }& z2 G% }% q
Res:string;; {3 t- q9 q D6 W, t) U
obj:object;. b' ?) |2 P; X) S& p) G
do3 ?8 e+ y8 e; @, {8 f! j5 B5 S
if existsObject("Status") then5 t+ t0 p! b0 ?) f
Status.deleteObject;0 a: G4 W; {3 M6 C7 U
end;7 Y5 F# y$ Q; `1 t W p
for i:=1 to 10 loop- E8 B; @: f: J& G
Res:=sprint("Store_",i);
8 }4 O0 Q3 ], ^8 L7 N( y if existsObject(Res) then
} D0 H& }2 p9 c7 G8 A Obj:=str_to_obj(Res);: b: g) P& ^9 C0 E( a; G
Obj.deleteObject;
: p$ ]' f4 z; p$ T end;
+ t6 h/ }4 V+ `2 ? P% j# n! C: ? next;
& S$ x$ D9 {: `( q! _$ n --shengcheng Status:zimoxingceng# |( V2 f8 F1 x
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");) y- L$ A s9 |% [2 m6 A9 b
Obj.Label:="warehouse status";
+ |+ \' I' R2 y+ k* g
0 V/ s; d9 l& w for i:=1 to WH_nums loop9 G D6 p7 `+ X9 x
Res:=sprint("Store_",i);& a: a* T" ^6 ^/ y: z
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res); _0 f/ A* P; [
Obj.Label:=sprint("huojiaceng:",i);
, r3 w% D4 D, K" h4 X Obj.xDim:=WH_x;7 S Z) {1 A0 l' E/ ^
Obj.yDim:=WH_y;
: a4 N+ }- P- g" | Res:=sprint("StoreData_",i);
2 X2 d+ E- o8 p5 f1 v! }/ F 9 B1 K8 f* k" f# o" F% I1 @
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);0 O# ?" V% t) f
Obj.Label:=sprint("huojiaceng:",i);
1 D8 `5 g0 R! C Obj.inheritFormat:=false;
S5 X: \! t, S+ W" g Obj.maxxDim:=WH_x;: `; ]8 L$ B& Z+ D8 z
Obj.maxyDim:=WH_y;: H' Y6 C) R1 G
Obj.ColumnWidth:=3;
# M; t! J+ S0 W9 Y& [ next;+ ]* W7 Z3 q0 q; V
% s. N( y3 a+ Q p .Delivery.MUs.Forklift.speed:=2;
6 F. T* K* U# R5 a& e WH_var.delete({1,Part_Nums+1}..{*,*});
% h# G. r0 Q) ], \4 n9 I for i:=1 to Part_Nums loop; ^9 m+ P s0 c' B& q- w& \# @% l
WH_var[1,i]:=chr(64+i);/ O/ O; U( H+ y" d4 k* Z
next;
8 ]$ S1 j- b! B2 n7 g6 Q yend;0 U( L h2 o$ @5 {
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
0 { A7 G3 l' D# Y8 {5 G. @
" k% B& e4 R/ e8 F4 f% A" _ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|