Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sat Nov 18, 2017 5:22 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: FileExists function
PostPosted: Wed Jun 17, 2009 9:43 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
This is a function you can paste into globals or an object template that can be used to check if a file exists.

Code:
func FileExists(fname as string) returns boolean
    dim size, ufs as integer
    dim flags as fileinfo_flags

    check error
        GetFileInfo(fname, size, ufs, flags)
    on error
        _clearException()
        return false
    enderr

    if flags == FILEINFO_ISNOT then
        return false
    endif

    return true
endfunc

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group