Jump to content
Sign in to follow this  
Ted at Miles

Last Line of Code Variable

Recommended Posts

Ted at Miles

How do I get a script to save the last line # of all the script code into a variable? For example, the first line of a 1,000 line script puts up a message, "There are 1,000 lines of code to run"

Or to allow the use of the actual # of lines as a progress bar control.

Share this post


Link to post
Share on other sites
_Kurt

Try using something like this:

#include <File.au3>
$count = _FileCountLines(@ScriptFullPath)
Msgbox(0,"","There are " & $count & " lines in: " & @CRLF & @ScriptFullPath)

UNTESTED

Hopefully that works, please note that this does NOT work in compiled form.

Kurt

Edit* minor correction in script example

Edited by _Kurt

Awaiting Diablo III..

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  

×