- is
+ g, ^' t5 z( \' h* w5 |7 S1 h3 b - r:real; file:string;2 a! d: k w* v4 w% [, \
- do! ?: r2 q" G! y* V
- openConsole;
; l! \' O- w$ I6 p" | c u - ( \) h: c/ N ~3 v
- /*
/ ~9 b/ `3 G. Y1 ]& |. _, L - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
- c, b8 V5 y( d+ \" O; l: J0 z - when is64BitApplication then 64 else 32,
/ V1 p! }2 q0 K4 U( u" d0 i - "bit.dll");
$ \; P& w* p% e4 {7 ^ - */
L; y( c+ S4 G8 T* \1 V# B - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
# S% Q- o* g- v7 Z1 G% u - local j := loadLibrary(file);
( D' i% H3 K! z1 A/ a( P
3 p* Y' d9 ^' Z, h" i- if j > 0 then7 c% w% V# k. B: J! i* t* w6 U
- print getLoadedLibrary(j)," is loaded."; W; _$ M3 T5 j2 h T5 I
7 ] X- m% h1 |- r := callLibrary(j, "calcSin", PI/6);7 u4 n- u5 s6 w% z# P" J
- promptmessage(to_str("sin(PI/6) = ", r));
( q* [) g; O2 o6 g- ~7 B7 c. q - 2 ]6 { A. G# K" S
- local str:string;
3 `; ~; Q! R4 S% x+ E - str := "I'm OK!";
- q/ v) R+ A$ H7 ^" e0 n* I - str := callLibrary(j,"resetStr",str);
7 s: f0 f( V. E: p& C) X3 U - promptmessage(str);
) U" O( m" e- M; ~2 T" ^2 {, g -
& R2 P3 h: S- d8 F) \ - callLibrary(j, "listAccess", Tablefile);
* Q+ j4 X7 R8 }3 h) E0 i - + l" c' H: @( V: n
- print "Unloading: ", freeLibrary(j);) `& T) P+ S. H- N. }% Z. v G, h7 ]
- end;
; W" C6 C! Y. g - end;
2 C2 ^1 l/ O) |! {$ J$ P
复制代码 |