From: shkang@dari.gsc.co.kr (Sungho Kang)
Subject: Clipper file creation problem
Organization: KAIST
X-Newsreader: Tin 1.1 PL3
Date: Wed, 14 Oct 92 00:42:56 GMT


_db_open()
c_main()   
_db_close()

FUNCTION _db_open() 
        select 1
                use tm  index  tmidx      
                if reccount() = 0
                        append blank
                endif

        select 2
                use tm_see index tmidx_se 
                if reccount() = 0
                        append blank
                endif

        select 3
                use tm_il index tmidx_il 

        select 4
                use dm index  dmbon , dmjo 
                if reccount() = 0         
                        append blank
        endif

        select 5
                use dm_see index  dmbonse, dmjose 
                if reccount() = 0         
                        append blank
        endif

return (.T.)


FUNCTION _db_close()               
        close all
return (.T.)

public f_date1
public f_date2
public f_nxt
public count
count = 0

FUNCTION _db_sv_tmm()   /*  */


        select 1                  
                f_date1 = "t"+substr( dtos( date() ),1,6 ) 
                f_date2 = f_date1             
                f_ntx   = f_date1            
                                           

                if ( ( FILE( f_date2+".dbf" ) == .F. ) .AND.;
		     ( FILE( f_ntx+".ntx" ) == .F. ) )
                        copy structure to &f_date2
                        index on tmdate to &f_ntx
                        count = 0       

                elseif ( ( FILE( f_date2+".dbf" ) == .T. )  .AND.;
			 ( FILE( f_ntx+".ntx"  ) == .F. ) )
                        index on tmdate to &f_ntx

                        count = 0       
                elseif ( ( FILE( f_date2+".dbf" ) == .F. )  .AND.;
	     		 ( FILE( f_ntx+".ntx"  ) == .T. ) )
                        copy structure to &f_date2

                        count = 0 
                endif


        tt1  =  tmdate
        tt2  =  tm_jung_ge
        tt3  =  tm_bon_su
        tt4  =  tm_bang_su
        tt5  =  tm_jo_su
        tt6  =  ok_chun_s
        tt7  =  chun_sun_s
        tt8  =  gun_bok_u
        tt9  =  bo_un_u
        tt10 =  i_won_u
        tt11 =  hwan_gan_u
        tt12 =  kum_san_u
        tt13 =  youn_don_u
        tt14 =  jin_an_u
        tt15 =  moo_joo_u
        tt16 =  jan_su_u
        tt17 =  ho_tan_s
        tt18 =  son_chun_s
        tt19 =  su_tong_s
        tt20 =  sin_ham_u
        tt21 =  chun_sun_u
        tt22 =  dea_sun_u
        tt23 =  chu_boo_u
        tt24 =  moo_poon_u
        tt25 =  gea_buk_u
        tt26 =  tm_hr_ur
        tt27 =  tm_sum_ur

        if ( count != 1 )
	/********************************/
>>	I think that this is error.
                select 6
                use &f_date2
                index on tmdate to  &f_ntx
                count = 1
	/********************************/
        endif

        if ( ( tt1 != "************" ) .AND. ( tt1 != "            " ) )

               select 6
               append blank
               replace tmdate          with   tt1
               replace tm_jung_ge      with   tt2
               replace tm_bon_su       with   tt3
               replace tm_bang_su      with   tt4
               replace tm_jo_su        with   tt5
               replace ok_chun_s       with   tt6
               replace chun_sun_s      with   tt7
               replace gun_bok_u       with   tt8
               replace bo_un_u         with   tt9
               replace i_won_u         with   tt10
               replace hwan_gan_u      with   tt11
               replace kum_san_u       with   tt12
               replace youn_don_u      with   tt13
               replace jin_an_u        with   tt14
               replace moo_joo_u       with   tt15
               replace jan_su_u        with   tt16
               replace ho_tan_s        with   tt17
               replace son_chun_s      with   tt18
               replace su_tong_s       with   tt19
               replace sin_ham_u       with   tt20
               replace chun_sun_u      with   tt21
               replace dea_sun_u       with   tt22
               replace chu_boo_u       with   tt23
               replace moo_poon_u      with   tt24
               replace gea_buk_u       with   tt25
               replace tm_hr_ur        with   tt26
               replace tm_sum_ur       with   tt27
        endif
return (.T.)


-------------------------------------------------------------
( I use Clipper5.01 and MSC 6.0 )

I have two problems in above code.

	1. error message : " cannot create VM swap file "

	    I think that this error is because of Function ( _db_sv_tmm() ) .
	    The function creates .dbf and .ntx ( named by current date ).
		( ex : t1992010.dbf t199210.ntx )

	    Is the syntax of the function right ?

	2. I know that can open files to 255 in Clipper 5.01.
	   Now I open 12 files, but I got error message "fopen() error message"
	   When link Clipper obj and C obj, this rule ( 255 files open ),
	   Is this rule invalid ?

	   Please help me!!!.

	   PS: I am sorry in my ugly english.
	   
Newsgroups: comp.databases