Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Read-entire-file/PureBasic/read-entire-file-1.basic
Normal file
10
Task/Read-entire-file/PureBasic/read-entire-file-1.basic
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Number.b = ReadByte(#File)
|
||||
Length.i = ReadData(#File, *MemoryBuffer, LengthToRead)
|
||||
Number.c = ReadCharacter(#File)
|
||||
Number.d = ReadDouble(#File)
|
||||
Number.f = ReadFloat(#File)
|
||||
Number.i = ReadInteger(#File)
|
||||
Number.l = ReadLong(#File)
|
||||
Number.q = ReadQuad(#File)
|
||||
Text$ = ReadString(#File [, Flags])
|
||||
Number.w = ReadWord(#File)
|
||||
4
Task/Read-entire-file/PureBasic/read-entire-file-2.basic
Normal file
4
Task/Read-entire-file/PureBasic/read-entire-file-2.basic
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
If ReadFile(0, "RC.txt")
|
||||
Variable$=ReadString(0)
|
||||
CloseFile(0)
|
||||
EndIf
|
||||
14
Task/Read-entire-file/PureBasic/read-entire-file-3.basic
Normal file
14
Task/Read-entire-file/PureBasic/read-entire-file-3.basic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Title$="Select a file"
|
||||
Pattern$="Text (.txt)|*.txt|All files (*.*)|*.*"
|
||||
fileName$ = OpenFileRequester(Title$,"",Pattern$,0)
|
||||
If fileName$
|
||||
If ReadFile(0, fileName$)
|
||||
length = Lof(0)
|
||||
*MemoryID = AllocateMemory(length)
|
||||
If *MemoryID
|
||||
bytes = ReadData(0, *MemoryID, length)
|
||||
MessageRequester("Info",Str(bytes)+" was read")
|
||||
EndIf
|
||||
CloseFile(0)
|
||||
EndIf
|
||||
EndIf
|
||||
Loading…
Add table
Add a link
Reference in a new issue