English
Source / code snippets

Fgc Fpc Unlink

 
Related: mutants as nProcs:  [...] 

same for with without XPSE in normal XProfan-Syntax:
proc FGC

    PARAMETERS FLE$

    IF %PCOUNT<1

        RETURN ""

    ENDIF

    var B&=FILESIZE(FLE$)

    IF B&<1

        RETURN ""

    ENDIF

    DECLARE MEM#
    DIM MEM#,B&
    var R&=BLOCKREAD(FLE$,MEM#,0,B&)
    var s$=CHAR$(MEM#,0,R&)
    DISPOSE MEM#
    RETURN ""+s$

endproc

proc FPC

    PARAMETERS FLE$,s$,_APPEND%

    IF %PCOUNT<1

        RETURN 0

    ENDIF

    IF %PCOUNT<2

        s$=""

    ENDIF

    IF %PCOUNT<3

        _APPEND%=0

    ENDIF

    var L&=LEN(s$)

    IF L&=0

        IF _APPEND%

            RETURN 1

        ENDIF

        var FH&=ASSIGN(FLE$)
        REWRITE FH&
        CLOSE FH&
        ASSIGN FH&,""
        RETURN 1

    ENDIF

    DECLARE MEM#
    DIM MEM#,L&+1

    IFNOT _APPEND%

        STRING MEM#,0=s$
        BLOCKWRITE FLE$,MEM#,0,L&
        DISPOSE MEM#

    ELSE

        var FH&=ASSIGN(FLE$)
        OPENRW FH&
        SEEK FH&,GETFILESIZE(FH&)
        STRING MEM#,0=s$
        BLOCKWRITE FH&,MEM#,0,L&
        DISPOSE MEM#
        CLOSE FH&
        ASSIGN FH&,""

    ENDIF

endproc

proc UNLINK

    PARAMETERS FLE$

    IFNOT FILEEXISTS(FLE$)

        RETURN 1

    ENDIF

    var FH&=ASSIGN(FLE$)

    IFNOT FH&

        RETURN 1-FILEEXISTS(FLE$)

    ENDIF

    ERASE FH&
    ASSIGN FH&,""
    RETURN IF(1-FILEEXISTS(FLE$),1,0)

endproc

 
04/14/10  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.484 Views

Untitledvor 0 min.
iF12/29/15
Hans Hermann04/13/15
GDL10/18/14
Dieter Zornow03/07/13
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie