Jump to content
zeenmakr

Where is @ScriptLineNumber

Recommended Posts

This is an internal Keyword, so you can't change that, but just install the Full version of SciTE4Autoit3 and you will have an easy AutoComplete function! ;) 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
6 hours ago, zeenmakr said:

I'm getting tired of typing this out and want to shorten it to something like @SLN but dont know which include file it is in.

AFAIK , the macros are not declared in one of the open standard UDF's.

I would add a new abbreviation to the SciTE editor.

=> Open au3.keywords.abbreviations.properties ---> add sln

==> Search for au3abbrev.properties (better : au3UserAbbrev.properties (create one, if it doesn't exist))

--> add :

sln=@ScriptLineNumber |

You can do this within the SciTE editor itself (-> Options) :

Abbrevs.thumb.png.da0147953fd88b6317d1be4f23a9bc59.png


Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites
1 hour ago, Jos said:

This is an internal Keyword, so you can't change that, but just install the Full version of SciTE4Autoit3 and you will have an easy AutoComplete function! ;) 

Also configurable abbreviation and I think that  you can have a shortcut sln > @ScriptLineNumber

 


Signature beginning:
Please remember: "AutoIt".....  Wondering who uses AutoIt and what it can be used for ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-03-17

Share this post


Link to post
Share on other sites

Go to sctite and in tools>scite config>other tools>run abrev manager>create

 

Alternatively:

If you dont have these filenames showing up in the options drop down menu:

au3UserAbbrev.properties

au3.keywords.user.abbreviations.properties

you can create them in: C:\Users\%userprofile%\AppData\Local\AutoIt v3\SciTE

then inside au3.keywords.user.abbreviations.properties you can have something like:

au3.keywords.userabbrev=sln

And inside au3UserAbbrev.properties:

sln=@ScriptLineNumber

After creating the abreviations you can save these files so you dont have to create again in case you format the pc or something.

Edited by careca

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

 

32 minutes ago, mLipok said:

Also configurable abbreviation and I think that  you can have a shortcut sln > @ScriptLineNumber

That's what I already suggested above and it works, or am I missing something ;)?


Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites

Totaly missed your post, what a waste of time.


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
24 minutes ago, careca said:

Totaly missed your post, what a waste of time.

I don't think it was a complete waste of time. There are different ways to get to the goal. Your post contains some information that might help @zeenmakr in case he does not understand my description. According to the motto, double works better :).


Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites
3 hours ago, careca said:

Totaly missed your post, what a waste of time.

any activities which engage your brain is not waste of time.

 

EDIT: btw. I missed too.

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt".....  Wondering who uses AutoIt and what it can be used for ?
* GHAPI UDF - modest beginning - communication with GitHub REST API Forum Rules *
Include Dependency Tree (Tool for analyzing script relations)
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) *

PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-03-17

Share this post


Link to post
Share on other sites
4 hours ago, Musashi said:

Your post contains some information that might help @zeenmakr in case he does not understand my description.

Looking back I did mention one thing extra: abrev manager

 

screenshot - 31052020-1545.png

Edited by careca

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
2 minutes ago, argumentum said:
ConsoleWrite(sln() & @CRLF)
ConsoleWrite(sln() & @CRLF)
ConsoleWrite(sln() & @CRLF)
Func sln($sln = @ScriptLineNumber)
    Return $sln
EndFunc

 

I like this, but even less typing:

 

sln()
sln()

Func sln($sln = @ScriptLineNumber)
    ConsoleWrite($sln & @CRLF)
    Return $sln
EndFunc

sln()

 

Share this post


Link to post
Share on other sites

Thanks all, this is alot of new infos and opening up new doors. the function trick is neat to tidy up the code and sure am going to abuse the macro method.

tried to edit au3.keywords.user.abbreviations.properties in np++ but file size is 0kb, open ok in SciTE but can't save unless run as admin. does au3.keywords.user.abbreviations.properties get generated on the spot? then where is the text stored?

Share this post


Link to post
Share on other sites
19 hours ago, Jos said:

This is an internal Keyword, so you can't change that, but just install the Full version of SciTE4Autoit3 and you will have an easy AutoComplete function! ;) 

What is the different between this Full version vs the standard one came with autoit installer? and should i copy and overwrite the standard one or use it as a portable?

Share this post


Link to post
Share on other sites

The advantages are "A lot" and just use the installer when you have used the AutoIt3 installer as well.

6 hours ago, zeenmakr said:

tried to edit au3.keywords.user.abbreviations.properties in np++ but file size is 0kb, open ok in SciTE but can't save unless run as admin. does au3.keywords.user.abbreviations.properties get generated on the spot? then where is the text stored?

Install the Full version first and then start trying all of this, because else you will get issues like this! ;) 

Jos

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
5 hours ago, zeenmakr said:

What is the different between this Full version vs the standard one came with autoit installer? and should i copy and overwrite the standard one or use it as a portable?

1. Full Version of SciTE :

The download page simply says : AutoIt Script Editor (Customised version of SciTE with lots of additional coding tools for AutoIt) - Installer containing SciTE and all configuration files plus utilities

I would definitely prefer the Full Version, because it provides many new features. Just Download and install it (you can probably use the Portable Version, but I haven't done that yet)

 

6 hours ago, zeenmakr said:

then where is the text stored?

2. Add an abbreviation (my way ;)) :

Open the SciTE-Editor (Full Version). Here again the proceeding (open spoiler with graphic)

Spoiler

AddAbbrevs.thumb.png.f96a62450541821b45b3295ef0a88a1b.png

-> Click on Options

-> Choose Open au3.keywords.abbreviations.properties ==> add sln -> Save

-> Choose Open au3UserAbbrev.properties ==> add (and save after) :

sln=@ScriptLineNumber |

Of course you can also use the Abbreviation Manager (see posting by @careca ) if you feel more comfortable with it - that's a matter of personal preference. Once you understand how the abbreviations work, you can integrate e.g. entire structures. This can save a lot of unnecessary typework.

Edited by Musashi
typo

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites

Very interesting, at least for me: I would have expected, that this would return *ALWAYS* "4", as the function's optional parameter is set to @ScriptLineNumber at line #4 at the first line opening the function block.

 

Looks like this "pre-fillment" of optional parameters is done at the line *CALLING* the function?

 

 

ClipSave.jpg


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

This makes sense to me. I wouldn't have it any other way.


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

I am using this with @error:
 

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #Tidy_Parameters=/reel /sf /ri
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#Region Variables/Opt
    Global Const $DEBUG = True
#EndRegion Variables/Opt

#Region Main
    _Main()

    Func _Main()
        SetError(0xDEAD)
        _LogError()
    EndFunc   ;==>_Main
#EndRegion Main

#Region Functions
    Func _LogError($p_iERR = @error, $p_iSLN = @ScriptLineNumber)
        If Not $p_iERR Then Return
        If Not $DEBUG Then Return
        ConsoleWrite("Error: 0x" & Hex($p_iERR, 4) & " @SLN " & $p_iSLN & @CRLF)
    EndFunc   ;==>_LogError
#EndRegion Functions

 

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...