| Tim Challenger |
I excluded the part which does the " 5 record database simulation".
This stuff is old hat.
/* 3. CANT provide varying record database support */
dcl testf file record;
DCL eof bit(1) init('0'B);
DCL datarec char(104);
dcl 1 typ1 based(addr(datarec)),
2 nf fixed bin(31),
2 date(3) fixed bin(31);
dcl 1 typ2 based(addr(datarec)),
2 nf fixed bin(31),
2 n fixed bin(31),
2 winners char(100);
dcl 1 typ3 based(addr(datarec)),
2 nf fixed bin(31),
2 commt char(100);
on endfile (testf) eof = '1'B;
eof = '0'B;
open file(testf) input;
datarec = '';
read file(testf) into (datarec);
do while(^eof);
select(typ1.nf);
when(1) put edit(typ1.date)(R(t1));
when(2) put edit('lotto winners: ',typ2.winners)(R(t2));
other put edit('unrecog. record format = ',typ1.nf)(R(tx));
end;
datarec = '';
read file(testf) into (datarec); /* get next record */
end;
close file(testf);
t1: format (skip, p'99B', p'99B', p'99');
t2: format (skip, a(15), a(length(trim(typ2.winners))));
tx: format (skip, a, a);
/*Outputs:
07 20 03
07 21 03
lotto winners: john doe, anthony soprano
07 22 03
unrecog. record format = 100
*/
--
Tim C.
|
|
|
| Tim Challenger |
On Thu, 27 May 2004 12:51:58 GMT, Tim Challenger wrote:
> I excluded the part which does the " 5 record database simulation".
> This stuff is old hat.
>
> /* 3. CANT provide varying record database support */
>
> dcl testf file record;
> DCL eof bit(1) init('0'B);
>
> DCL datarec char(104);
> dcl 1 typ1 based(addr(datarec)),
> 2 nf fixed bin(31),
> 2 date(3) fixed bin(31);
>
> dcl 1 typ2 based(addr(datarec)),
> 2 nf fixed bin(31),
> 2 n fixed bin(31),
> 2 winners char(100);
>
> dcl 1 typ3 based(addr(datarec)),
> 2 nf fixed bin(31),
> 2 commt char(100);
>
> on endfile (testf) eof = '1'B;
> eof = '0'B;
>
> open file(testf) input;
> datarec = '';
> read file(testf) into (datarec);
>
> do while(^eof);
> select(typ1.nf);
> when(1) put edit(typ1.date)(R(t1));
> when(2) put edit('lotto winners: ',typ2.winners)(R(t2));
> other put edit('unrecog. record format = ',typ1.nf)(R(tx));
> end;
> datarec = '';
> read file(testf) into (datarec); /* get next record */
> end;
> close file(testf);
>
> t1: format (skip, p'99B', p'99B', p'99');
> t2: format (skip, a(15), a(length(trim(typ2.winners))));
> tx: format (skip, a, a);
>
> /*Outputs:
> 07 20 03
> 07 21 03
> lotto winners: john doe, anthony soprano
> 07 22 03
> unrecog. record format = 100
> */
Oops,
Please accept my apologies. Wrong group, er obviously!
Sorry.
--
Tim C.
|
|
|
| Tim Challenger |
On Thu, 27 May 2004 11:28:05 -0400, Yeff wrote:
> On Thu, 27 May 2004 12:53:07 GMT, Tim Challenger wrote:
>
>> Oops,
>> Please accept my apologies. Wrong group, er obviously!
>
> Wrong group? So what am I supposed to do with the two tablespoons of
> butter, the diced onion and the cat?
Blender. Works wonders. ;-)
Sort of like ratatouille, but with cat instead of rat.
--
Tim C.
|
|
|
| Yeff |
On Thu, 27 May 2004 12:53:07 GMT, Tim Challenger wrote:
> Oops,
> Please accept my apologies. Wrong group, er obviously!
Wrong group? So what am I supposed to do with the two tablespoons of
butter, the diced onion and the cat?
--
-Jeff B.
yeff at erols dot com
|
|
|
| Steve Wertz |
On Thu, 27 May 2004 12:51:58 GMT, Tim Challenger
<"timothy(dot)challenger(at)apk(dot)at"> wrote:
> do while(^eof);
> select(typ1.nf);
> when(1) put edit(typ1.date)(R(t1));
> when(2) put edit('lotto winners: ',typ2.winners)(R(t2));
> other put edit('unrecog. record format = ',typ1.nf)(R(tx));
> end;
> datarec = '';
> read file(testf) into (datarec); /* get next record */
> end;
> close file(testf);
A language I've never studied. What is it?
-sw (Turtle Logo expert ;-)
|
|
|
|