root/tags/5.52/rec1.c

Revision 4, 0.9 kB (checked in by heitor.barbieri, 2 years ago)

Versão 5.52 do cisis (28/04/2010)

Line 
1#include <stdio.h>
2#include "cisis.h"
3#include "cirun.h"
4
5void main(argc,argv)
6int argc;
7char *argv[];
8{
9    int i;
10    RECSTRU *recp;
11    LONGX irec=0L;
12    int x;
13
14    LONGX mfn,parmfrom=1,parmto=99999999, parmtell=0;
15
16    if (argc < 2) fatal("rec1 <dbn> [<from>] [<to>] [<tell>]");
17
18    for (i=0; i<argc; i++) {
19        printf("parm#%d = %s \n",i,argv[i]);
20    }
21//    printf(".."); x=getchar();
22//    if (x == 'x') exit(1);
23
24    if (argc >= 3) parmfrom=atol(argv[2]);
25    if (argc >= 4) parmto  =atol(argv[3]);
26    if (argc >= 5) parmtell  =atol(argv[4]);
27
28    for (mfn=parmfrom; mfn<=parmto; mfn++) {
29        RECORD(irec,argv[1],mfn);
30        if (RECrc == RCEOF) break;
31        if (RECrc != RCNORMAL) continue;
32        if (parmtell) {
33           if (mfn%parmtell==0) printf("+++ mfn=%ld\n",mfn);
34        }
35        else prtfields(recp,MFRmfn);
36    }
37
38    exit(0);
39}
Note: See TracBrowser for help on using the browser.