Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I recognize a file to delete
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00573345
Message ID:
00573958
Views:
29
What do you see if you open input file using MODI COMM ?

>This is strange -
>The Record length should be 320 char max!
>The File Size could be enormous...
>
>I get the correct file (BUT EMPTY) in correct directory ...
>Tested for 6 recs
>read-in-rec buffer is always empty???
>
>
>PROCEDURE Readable  && Check to see if the file is readable
>	PARAMETER cFile
>	LOCAL m.nFileReady
>	m.nFileReady = FOPEN(cFile)
>	IF m.nFileReady = -1
>		RETURN .F.
>	ELSE
>		=FCLOSE(m.nFileReady)
>		RETURN .T.
>	ENDIF
>ENDPROC
>
>PROCEDURE Destiny
>      nTest= 0
>        gnOrigin = FOPEN(SubStr(cMedSearch,1,6)+laFileList[i, 1],1)
>        *   ELB Debug: Destination I:\BBS\DATA\CLAIMS\NSF\"+cDestDirect
>        gnFile = FCREATE('c:\'+cDestDirect+'\'+laFileList[i, 1]+cFileExt)
>        IF gnFile < 0
>            WAIT WINDOW NOWAIT '*** Could not create file! '+laFileList[i, 1]+cFileExt
>        ELSE
>            DO WHILE !FEOF(gnOrigin)
>      nTest= nTest+ 1
>                m.buffer = FGETS(gnOrigin)
>                nFAIL=FPUTS(gnFile, m.buffer)
>                IF nFAIL = 0 .OR. nTest > 6
>                    nERRCNT= nERRCNT+ 1
>                    WAIT WINDOW NOWAIT "*** ERR WRITING RECORD "+laFileList[i, 1]+ ' in '+cDestDirect
>                    =FCLOSE(gnFile)  && Close NEW file
>                    =FCLOSE(gnOrigin)&& Close Original File
>                    RETURN
>                ENDIF
>            ENDDO
>            =FCLOSE(gnFile)  && Close NEW file
>            =FCLOSE(gnOrigin)&& Close Original File
>        ENDIF
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform