1 03/05/80 apl_pickup_float_bin_2_ external function
2
3 Function: read double-precision floating point numbers into apl.
4
5
6 Usage:
7 )MFN PICKUP APL_PICKUP_FLOAT_BIN_2_
8 V -^H< PICKUP 'PATH'
9
10
11 Arguments:
12 PATH
13 is the pathname of a segment containing the numbers. The bitcount
14 must be set to 72 times the number of elements.
15
16 V
17 is the vector of numbers that is returned.
18
19
20 Sample PL/I program:
21 sample:
22 procedure;
23
24 declare code fixed bin 35;
25 declare com_err_ entry options variable;
26 declare float builtin;
27 declare get_wdir_ entry returns char 168;
28 declare hcs_$make_seg entry char * char * char * fixed bin 5 ptr fixed bin 35;
29 declare hcs_$set_bc entry char * char * fixed bin 24 fixed bin 35;
30 declare idx fixed bin;
31 declare null builtin;
32 declare number_array 130560 float bin 63 based number_array_ptr;
33 declare number_array_ptr ptr;
34 declare RW_mode fixed bin 5 initial 01010b internal static options constant;
35 declare working_dir char 168;
36
37 working_dir = get_wdir_ ;
38
39 call hcs_$make_seg working_dir "number_array" "" RW_mode number_array_ptr code;
40 if number_array_ptr = null
41 then do;
42 call com_err_ code "sample" "^a>^a" working_dir "number_array";
43 return;
44 end;
45
46 do idx = 1 to 100;
47 number_array idx = float idx 63;
48 end;
49
50 call hcs_$set_bc working_dir "number_array" 72 * idx - 1 code;
51 if code ^= 0
52 then call com_err_ code "sample" "^a>^a" working_dir "number_array";
53
54 end sample;
55
56
57 Sample FORTRAN program:
58 dimension data 100
59 real*8 data
60 integer i
61 c
62 open 1 binary stream=.true. file="number_array" mode="out"
63 do 10, i = 1, 100
64 data i = dble float i
65 10 continue
66 write 1 data
67 close 1
68 end