$EOF when using Line Input#
#1
Source code moved from PB DOS over here, in reply to @Andy Dee:

Code:
#compile exe
#dim all

function pbmain () as long
    local hFile as long
    local sFile as string
    local sTemp as string

    '
    ' Setup strings
    ' -------------
    '
    sTemp = "ABCDEF" + $EOF + "abcdef"
    sFile = "Data.txt"

    '
    ' Create Data.txt
    ' ---------------
    '
    hFile = freefile
    open sFile for output as #hFile
    print #hFile,sTemp;
    close #hFile

    '
    ' Read Data.txt using get$
    ' ------------------------
    '
    hFile = freefile
    open sFile for binary as #hFile
    get$ #hFile,lof(hFile),sTemp
    close #hFile
    stdout "Using get$:        "+sTemp

    '
    ' Read Data.txt using line input#
    ' -------------------------------
    '
    hFile = freefile
    open sFile for input as #hFile
    line input #hFile,sTemp
    close #hFile
    stdout "Using line input#: "+sTemp

    '
    ' Clean up
    ' --------
    '
    kill sFile

end function
„Let the machine do the dirty work.“
The Elements of Programming Style, Brian W. Kernighan, P. J. Plauger 1978
Reply


Messages In This Thread
$EOF when using Line Input# - by Albert Richheimer - 03-12-2025, 08:25 AM

Forum Jump:


Users browsing this thread: