Changes between Initial Version and Version 2 of Ticket #3882
- Timestamp:
- 05/11/22 15:10:19 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3882
- Property Version changed from 3.3.14.0 to
-
Ticket #3882 – Description
initial v2 1 1 I would like to write UDFs that (just like FileOpen) accept as input either valid filename OR (AutoIt) filehandle (actually an integer), but there is no way for me to check whether any integer parsed as a filehandle is referring to a currently valid file previously opened with FileOpen. For the moment I'm using this hack: 2 2 3 {{{#!autoit 3 4 Func _IsValidFileHandle($fh) 4 5 FileGetPos($fh) ; non-invasive interaction 5 6 Return (@error=0) ; an invalid (integer) AutoIt file handle triggers an error 6 7 EndFunc 8 }}} 7 9 8 10 But since various file functions already error out when an invalid AutoIt filehandle is parsed, it must be trivial to implement an IsFileHandle() function to perform this check internally.