It would be nice to be able to get more exact error information from Copy and Rename file functions.
At the moment, we have 0 if they fail, nonzero if they don't fail.
Would like some more depth to this if possible.
And maybe other file/filesystem commands as well please?
*EDIT* Never mind, GetLastError_ will do
More error data for copy and rename functions.
- Fangbeast
- PureBasic Protozoa
- Posts: 4789
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
More error data for copy and rename functions.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Re: More error data for copy and rename functions.
A native GetLastError() would be cool!
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
Re: More error data for copy and rename functions.
purebasic native last error would rely on GetLastError() anyway.
Re: More error data for copy and rename functions.
It's meant to be cross platform, to get internal errors of PureBasic functions.xorc1zt wrote:purebasic native last error would rely on GetLastError() anyway.
Most functions just return 0 on error, so you would call the PB error function
to get a code to know what happened.
Code: Select all
#PB_Error_File_NotFound ; OpenDatabase, ReadFile, LoadFont, LoadImage, OpenLibrary, ...
#PB_Error_Disk_Full ; All file write functions (SaveImage, CreatePack, WritePreferenceXXX, WriteData, WriteLong, ...)
#PB_Error_File_NoAccess ; all file functions, same than the two points above
#PB_Error_FileSystem_NoAccess ; all file system functions (directory reading etc.)
#PB_Error_Disk_ReadOnly ; all file write functions when used on a read-only device
#PB_Error_OutOfMemory ; AllocateMemory, AddElement, CreateImage, CreateSprite, CreateMesh, AddMapElement, CopyArray, OpenWindow, ...
#PB_Error_Network_ConnectionTimeOut ; all network functions, SendMail etc..
#PB_Error_Network_NoConnection ; all network functions, SendMail etc..
#PB_Error_Network_SendFailed ; all network send functions
other functions that allocate memory internally. CreateXXX, OpenXXX, ...
Why did LoadSprite fail? FileNotFound? OutOfMemory? UnsupportedImageFormat (InvalidData)? no access rights to that directory?
Re: More error data for copy and rename functions.
Danilo is right, this could be a useful feature.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!