Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

File.Lenght Problem



  • Please log in to reply
2 replies to this topic
AHKTeo14
  • Members
  • 9 posts
  • Last active: Jul 16 2018 09:32 PM
  • Joined: 09 Apr 2014
Hi,
i have a Problem with the AutoHotKey File Object.
Code Example:

#NoEnv
fl := FileOpen("C:\Windows\win.ini", "r")
if ! IsObject(fl)
{
MsgBox % "failed"
ExitApp
}
sResult:="File Lenght: " fl.Lenght "`r"
sResult.=fl.Read(30)
fl.Close()
MsgBox % sResult
ExitApp

Every File i try, "File.Lenght" will never return any Value.
But File access is available, File.Read() works fine.

Thanks in advance.

Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013
✓  Best Answer
FileSize := File.Length

File object

 

 

You have length spelled wrong.

 

HTH



AHKTeo14
  • Members
  • 9 posts
  • Last active: Jul 16 2018 09:32 PM
  • Joined: 09 Apr 2014
Hi Xtra, thanks for this, now it works.