ªþÄݵ{¦¡
ì©lµ{¦¡
ì©lÀɡа_©l /*---------( W_FSAC.H )------------------*/ #define MAIN #define HP-5L /* X0=200 X4=171 X8=150 X12=133 X16=120 X20=109 X24=100 */ #include "w_obj.h" #define GET_NAME UGetName("\\tc\\");GetSysY() FILE *fpNDX; #define NDXL 29 /* ¨Cµ§¯Á¤Þªø«×, KEY[8] + ACN[21] = 29 */ #define NDXDISK "FSACF001.NDX" int SysY,Sa,Ea,Sm,Em; /*===========================================================================*/ typedef struct { char KEY[8] ; /* ¬ì¥Ø½s¸¹ */ char ACN[21] ; /* ¬ì¥Ø½s¸¹¦WºÙ */ int DC_NO[2][25]; /* Ó¤ë¥÷¶Ç²¼É¶U¼Æ,°ßNO[0]¤£¨Ï¥Î */ double AMT[2][25]; /* 0 ¬Oɤè 1 ¬O¶U¤è , 1-24 ¬OɶU¦U¤ë¥÷ª÷ÃB,0 ¬O¤W´Áµ²Âà */ char DC; } FSACF001_T; /* ·| p ¥D ÀÉ */ FKIP *ACF001K; /* ·| p ¥D ÀÉ 8=KEY 8 bytes, 0=µL¤À¿ý, 2=index ¥i«ü¨ì 65536 µ§ */ #define OPEN_ACF001 ACF001K=Ufk_Open("FSACF001",sizeof(FSACF001_T),8,0,2) /*===========================================================================*/ typedef struct { char KEY[8] ; /* ¶Ç²¼½s¸¹ */ char AC[8] ; /* ¬ì¥Ø½s¸¹ */ char RM[34] ; /* ºKn.쬰27*/ char KI ; /* ¶Ç ²¼ §O */ char DC ; /* É ¶U */ DATE YM ; /* ¶Ç²¼¤é´Á */ double AMT ; /* ª÷ ÃB */ DATE CYM ; /* §I²{¤é´Á */ } FSACF011_T; /* ¶Ç ²¼ ¥D ÀÉ */ FKIP *ACF011K; /* ¶Ç ²¼ ¥D ÀÉ 8=KEY 8 bytes, 1=¤À¿ý¥i«ü¨ì 256 µ§, 2=index ¥i«ü¨ì 65536 µ§ */ #define OPEN_ACF011 ACF011K=Ufk_Open("FSACF011",sizeof(FSACF011_T),8,1,2) /*===========================================================================*/ typedef struct /* ±`¥Î¶Ç²¼ */ { char KEY[6] ; /* ±`¥Î½s¸¹ */ char NAM[17] ; /* ±`¥Î¦WºÙ */ char AC[8] ; /* ¬ì¥Ø½s¸¹ */ char RM[34] ; /* ºK n */ char KI ; /* ¶Ç ²¼ §O */ char DC ; /* É ¶U */ double AMT ; /* ª÷ ÃB */ } FSACFA11_T; /* ±`¥Î¶Ç²¼®æ¦¡Àx¦sÀÉ */ TEXT *TxFA11; FKIP *ACFA11K; /* ±`¥Î¶Ç²¼®æ¦¡Àx¦sÀÉ 6=KEY 6 bytes, 1=¤À¿ý¥i«ü¨ì 256 µ§, 2=index ¥i«ü¨ì 65536 µ§ */ #define OPEN_ACFA11 ACFA11K=Ufk_Open("FSACFA11",sizeof(FSACFA11_T),6,1,2) /*===========================================================================*/ typedef struct /* ±`¥ÎºKn */ { char KEY[4]; /* ºKn½s¸¹ */ char RM[34]; /* ºKn¦WºÙ */ } FSACF002_T; /* ºKnÀÉ */ TEXT *TxMemo; FKIP *ACF002K; /* ºKnÀÉ 4=KEY 4 bytes, 0=µL¤À¿ý, 2=index ¥i«ü¨ì 65536 µ§ */ #define OPEN_ACF002 ACF002K=Ufk_Open("FSACF002",sizeof(FSACF002_T),4,0,2) /*===========================================================================*/ #define FMT_L 42 typedef struct { char ACN[23]; /*¬ì¥Ø¦WºÙ*/ char AC[2][8]; /*0°_©l¬ì¥Ø½s¸¹,1µ²¤î¬ì¥Ø½s¸¹ */ double AMT[2]; /*0¥»¤ë,1(¸ê)¤W¤ë.(·l)²Öp */ char FMT[FMT_L]; /*pºâ¤½¦¡ */ char M; /*¤À¥Àªº°O¸¹ */ char C; /*°O¸¹ */ char SW; /*§PÂ_¥»¶µ¬O§_¤wpºâ§¹²¦ */ } FSACR063_T; /* ·l ¯q ªí*/ /*===========================================================================*/ void GetSysY() { if((Stream=fopen("FSACYY","r"))==NULL) UFatal("µL·|p¦~«×ÀÉ"); fgets(BufS,10,Stream); SysY=atoi(BufS); fclose(Stream); } /*===========================================================================*/ int ChkYM(DATE YM,int sw) /*¶Ç¦^¹ïÀ³ªº°}¦C¤ë¥÷*/ { if(YM.Y==SysY) return YM.M; if(YM.Y==SysY+1) return YM.M+12; /*¤U¦~«×*/ if(sw) { Ugd_Open("%02d.%02d.%02d »P¨t²Î¦~«×¤£²Å",YM.Y,YM.M,YM.D); beep(); UGetKb(); Ugd_Close(); } return 0; } /*===========================================================================*/ void ACF001Tx() /*Ū¤Jfsacf001.ndx ¯Á¤ÞÀÉ */ { /*ìstatic int HasRead=OFF; 95/03/19*/ if(HasRead==ON) return; /*ÀRºA¥u¦³¦¹¨ç¦¡¤º¥i§ï,¦ýfsacp001n³]OFF¨Ó«¾ã*/ fclose(fpNDX); if((fpNDX=fopen(NDXDISK,"r+b"))==NULL) UFatal("µL¬ì¥Ø¯Á¤Þ"); L=filelength(fileno(fpNDX))/NDXL+30; /*pºâ°t¸mÓ¼Æ*/ Tx=Utx_Open(45,4,76,23,L,8,ON); while(1) { if(fread(TmpS,NDXL,1,fpNDX) < 1) break; if(TmpS[0]>SPACE) Utx_Ins(Tx,TmpS); } HasRead=ON; } ì©lÀɡе²§ô
ì©lµ{¦¡
ì©lÀɡа_©l /*---------( W_ACP001.C )-------------*/ char *ChainDc(); void Write2Page(); void Read2Page(int x,int y); char *Tabl2="\ ùï¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢wùñ \ ùø ¬ì ¥Ø: ùø \ ùø ¦W ºÙ: ùø \ ùø ɶU§O: ùø \ ùõ¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢wù÷ "; void ACP001(int x,int y,char *s) { int fi=1,md=Modify; UGetTitle(" ·s ¼W ¬ì ¥Ø "); if(y>=20) y=20; Wo=Uwo_Open(x,y,x+34,y+4); Ugd_Open("Esc:©ñ±ó«ØÀÉ F4:¬d¬ì¥Ø PgDn:¦s¤J«áªð¦^"); UShowTable(x,y,x+34,y+4,Tabl2,V_TABLE); memset(&ACF001,NULL,sizeof(ACF001)); strcpy(ACF001.KEY,s); Read2Page(x,y); while(1) { switch(fi) { case 1: if(UReadS(x+11,y+1,7,ACF001.KEY,"NL",V_SHOW,V_READ)) Read2Page(x,y); break; case 2: UReadS(x+11,y+2,20,ACF001.ACN,"CL",V_SHOW,V_READ); break; /* case 3: UReadC(x+11,y+3,&ACF001.DC,"DC",V_SHOW,V_READ_F); UShowS(x+13,y+3,ChainDc(),V_SHOW); break; */ case 3: UReadTog(x+11,y+3,4,&ACF001.DC,V_TOG,"DC","É","¶U"); UShowS(x+11,y+3,ChainDc(),V_SHOW); break; } switch(RetKey) { case F4 : Utx_View(Tx,""); break; case LEFT : case UP : if(--fi<1) fi=5; break; case RIGHT : case DOWN : if(++fi>5) fi=1; break; case PGDN : Write2Page(); strcpy(s,ACF001.KEY); case ESC : Ugd_Close(); Uwo_Close(Wo); Modify=md; UPutTitle(); if(RetKey==ESC) RetKey=OFF; else RetKey=RIGHT; return; } } } /*===========================================================================*/ void Show2Page(int x,int y) { UShowSL(x+11,y+1,7,ACF001.KEY,V_SHOW); UShowSL(x+11,y+2,20,ACF001.ACN,V_SHOW); UShowS(x+11,y+3,ChainDc(),V_SHOW); } /*===========================================================================*/ void Read2Page(int x,int y) { if(Ufk_Read(ACF001K,&ACF001,NULL)==OFF) /* Ū¤£¨ì */ memset(&ACF001.KEY[0]+sizeof(ACF001.KEY),NULL,sizeof(ACF001)-sizeof(ACF001.KEY)); if(ACF001.KEY[0]<=SPACE) UClsField(x+20,y+1,8,V_SHOW); else if(ACF001.KEY[0]<='3' || ACF001.KEY[0]=='Z') UShowS(x+20,y+1,"(¹ê¬ì¥Ø)",V_SHOW); else UShowS(x+20,y+1,"(µê¬ì¥Ø)",V_SHOW); Modify=OFF; Show2Page(x,y); /*Ū¤J®É¤@©wnModify=OFF*/ } /*===========================================================================*/ void Write2Page() { if(Modify==OFF) return; if(ACF001.KEY[0]==NULL){ UWait(ON,"µL¬ì¥Ø½s¸¹ ¡DEnter קï"); Field=1; return; } if((L=Ufk_Write(ACF001K,&ACF001)) >= 0L) { sprintf(BufS,"%-7s %-s",ACF001.KEY,ACF001.ACN); fseek(fpNDX,L*NDXL,SEEK_SET); fwrite(BufS,NDXL,1,fpNDX); Utx_Del(Tx,BufS); Utx_Ins(Tx,BufS); } } /*===========================================================================*/ char *ChainDc() { switch(ACF001.DC) { case 'D': return " É "; case 'C': return " ¶U "; default : return " "; } } ì©lÀɡе²§ô
Byron Wey¡@¡@Oct.21.1998