Jump to content
Sign in to follow this  
JustDoIt

EOF function ? TIME$ function ?

Recommended Posts

JustDoIt

Newbie here. I am looking for AutoIt's function that does "EOF". Can someone tell me what that is ?

Also, does AutoIt have something similar to BASIC's TIME$ function ?

Thank you.

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

EOF = end of file?

$time= ???

What do you want to do?

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
JustDoIt

EOF = end of file?

Yes.

$time= ???

What do you want to do?

To return the system time.

Share this post


Link to post
Share on other sites
ChrisL

#Include <Date.au3>
_NowTime ( [$sType] )

$sType

Default: 3 = Display a time using the time format specified in your computer's regional settings.

4 = Display a time using the 24-hour format (hh:mm).

5 = Display a time using the 24-hour format (hh:mm:ss).

Share this post


Link to post
Share on other sites
JustDoIt

Thanks Christ for pointing out _NowTime function

Is this code considered EOF function ?

$x = FileReadLine("C:\someFile.txt")
If @error = -1 Then

Share this post


Link to post
Share on other sites
sandman

This will work to get the last line of a file:

#include <File.au3>

$lines = _FileCountLines("file.txt")
$line = FileReadLine("file.txt", $lines)


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites
ChrisL

Thanks Christ for pointing out _NowTime function

Is this code considered EOF function ?

$x = FileReadLine("C:\someFile.txt")
If @error = -1 Then
Yes in what you are doing if @error returns -1 then you have reached the end of file

From the help file...

Sets @error to -1 if end-of-file is reached.

Share this post


Link to post
Share on other sites
sandman

You can just put that in a loop:

Do
    $x = FileReadLine("C:\somefile.txt")
Until @error = -1
But instead of doing the loop, which could take a while, try the way I suggested earlier. Only one FileReadLine, because if the file was big this method would take a loooooooong time.


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.