Jump to content
Sign in to follow this  
jmon

How to correctly post AutoIt code to the forum?

Recommended Posts

Hello,

When I want to post some code to the forum, I always have some issues on how to paste it correctly so the code looks correct in my post.

The problems I ran into are:

- the tab indent disapear

- some smileys appear with some regexp patterns

- the forum try to auto format the text and add some html tags in my regexp patterns

- paste the code in "toggle edit mode" to keep the tab indents but this method adds some html tags here and there

- I don't know about you guys, but when I try to paste some code in the "Special BB code" and select "Autoit" then the window stretches up and I cannot click the button to validate (the button goes out of my screen (Google Chrome and Windows 7 x64))!

I tried several ways and it seems that the best way of doing it is:

1 - Paste the code as plain text (to make sure no text formatting is kept)

2 - write myself the [ autoit ] tags at the beginning and end of the code

3 - now the problem is that this method doesn't keep the tab indents.

I was thinking that there should be a tutorial pinned in every forum, because I've seen that I am not the only one having troubles with it.

So if you have some tips, I'd be happy to know them so I don't pull my hairs every time!

jmon.

[EDIT]

Solved: So it's a problem with the IPB forum editor, so while there is no update, the best way of doing it is (From Melba23 and BogQ):

1 - Toggle "Edit mode" (Top left of the text editor)

2 - do all you things in edit mode

3 - add manually the autoit tags for autoit code ([*autoit*] for the beginning, [*/autoit*] for the end (remove the stars))

4 - preview your post. If there is unwanted html tags, then remove them manually

5 - post

This method keeps the TAB indents, but sometimes add some unwanted html tags in RegExp Patterns and URLs. Also sometimes, #includes containing "<" or ">" will disappear. In this case, preview your post and if you notice this then just write them again...

Edited by jmon

Share this post


Link to post
Share on other sites

just do from the start to the end in toggleded mode and add every tag by hand and youl probably not have any problems ;)

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

jmon,

This is a problem with the IPB forum editor - and each time Jon posts a bug report it comes back "cannot reproduce". :(

It does however seem to be very browser dependent and so each case is slightly different. Personally I use the "basic" editor mode (as opposed to the "WYSIWYG" version - you toggle using the button at top left) and add all my tags by hand. I get very few problems - other than the addition of <b></b> tags in the middle of some URL tags. I suggest you post like that for now and hope that the next update gets us a better built-in editor. ;)

M23


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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

@BogQ and @Melba23

Thanks for you help. I'm glad to see that I'm not the only one having the issue. I will use the "toggle editing mode" from now on!

Another bug I got sometime, is the includes are removed sometimes (I guess when they contain "<" or ">"), so posting something like this:

#include <imagesearch.au3>
#include <Array.au3>

may come out like this sometimes:

#include 
#include <Array.au3>

Share this post


Link to post
Share on other sites

jmon,

Same problem - same solution as far as I am concerned. ;)

M23


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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Strange that they (IPB) can't reproduce it, but hundreds of users can.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

@M23 - Thanks, works perfectly

@jmon - There is a test thread in the CHAT forum for testing various posting methods

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Dan_555
      Hi, 
      i'v just uploaded my latest project: Simple Snippet Manager to the Downloads. area :

       

       The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor.
          The Copy/Paste process happens over the (windows)Clipboard. 
          The previous clipboard content is not restored.
          There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive).  
          The Hotkey is reenabled, when the main Window is activated.
          
          This is a File/Folder based manager. 
          The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders.
          
          The root folder is freely selectable, but it  should be a Folder with writing permission.
          Please install the App in a folder with Writing permission, too. 
          This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App.
          
      First configuration:
      1. Open the config Window.
      2. Enter the Language name, create or seek a root folder, enter an extension.
      3. Click on Set button.
      4. Click on the Exit button.
      The Language configuration is done, adding files or folders are needed:
       1. Select the language from the dropbox list, and click on Get Lang button.
      2a. Right Click on the root folder, chose New folder to add categories.
      2b. or chose New/Edit file to open the builtin text editor
       3. Paste or Write a snippet-code, enter a filename and save it.
       
       (Repeat the 3. as needed)
       
      Usage:
      Select a language, then click on Get Lang button.
      Choose a file with the left mouse button.
      Check if the code was loaded in the Textarea at the bottom.
      Switch to your Sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text.
      There is a time limit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed.
      Changelog:
      V1.02        (24.06.2020)
                  Addition: Undocumented ini setting: StartLoadLastUsedLanguage
                            Setting this to 1 (default value) will now reload the Last used language at start.
                            Last used language counts for the Language, selected with [Get Lang] button. The [Config] button will delete the last used language.
                            LastUsedLanguageNr, LastUsedLanguageName ini settings are used internaly for the above function.
                   Added version string to the main Window title.
      V1.01        (23.06.2020)
                  Bugfix    : Starting the App without the ini file now sets the correct starting Hotkey (Ctrl b)
                  Addition: Clipboard is saved, before pasting, and restored after pasting. (May work with text data only. p.s. untested!)
    • By Dan_555
      Simple Snippet Manager (AutoIt v3.3.14.5)
       The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor.
          The Copy/Paste process happens over the (windows)Clipboard. 
          The previous clipboard content is not restored.
          There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive).  
          The Hotkey is reenabled, when the main Window is activated.
          
          This is a File/Folder based manager. 
          The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders.
          
          The root folder is freely selectable, but it  should be a Folder with writing permission.
          Please install the App in a folder with Writing permission, too. 
          This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App.
          
      First configuration:
      1. Open the config Window.
      2. Enter the Language name, create or seek a root folder, enter an extension.
      3. Click on Set button.
      4. Click on the Exit button.
      The Language configuration is done, adding files or folders are needed:
       1. Select the language from the dropbox list, and click on Get Lang button.
      2a. Right Click on the root folder, chose New folder to add categories.
      2b. or chose New/Edit file to open the builtin text editor
       3. Paste or Write a snippet-code, enter a filename and save it.
       
       (Repeat the 3. as needed)
       
      Usage:
      Select a language, then click on Get Lang button.
      Choose a file with the left mouse button.
      Check if the code was loaded in the Textarea at the bottom.
      Switch to your sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text.
      There is a timelimit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed.
       
      The Download includes:
      32 + 64bit exe, sourcecode, icon, read me text and 2 Instructional Helpfiles in Html and PDF format.
    • By Fernandin
      Let me get it straight...
      I've been having such a great experience with AutoIt, it helped me a lot at my work. And now, I gotta make some configurations in the BIOS of many computers at my work. So, I'd like to know,  is it possible to use AutoIt (or some programming language) to write an algorithm that when compiled and transefered to a pen drive, it's "plug and run"? 
    • By Skeletor
      Hi All,
      It has been bugging me for a while now. 
      Can you view the AutoIt code from within a compiled exe. Like how you can with most .Net exe's by using a certain program.
      If this is possible, how then can I secure my program (if this method exists).
       
    • By Jemboy
      Yesterday I had to make some little changes to an old Autoit program we use at my work.
      The program reads some data and convert it to Excel.
      Before writing the cell, it is changed to text and later on I slap the column with an autofitwidth.
      Furthermore weI execute a conditional format on the sheet, to make the data more readable.
      I quickly found out that because of the breaking changes Excel.udf had starting from AutoIt 3.3.12.0,
      a lot of things had to been changed.
      The changes I had to do, only took 10 minutes.
      After trying to adjust the script for over 5 hours, to get it working with the new Excel.udf, I gave up.
      I stopped changing the script, uninstalled the my Autoit and went looking for an older version.
      Luckilly I was able to find Autoit v3.3.8.1 (with corresponding Scite) in my software repository.
      Installing Autoit V3.3.8.1 and compiling the file, now took me  10 minutes .
       
      So why did I not get the old script working with the new Excel.udf?
      There are several reasons I failed getting the old script working with the new Excel UDF.
       I had some pressure from management to fix it ASAP (and got a little anxious)  Most all resources on the internet point to the working of the old EXcel.UDF And offcourse there were thosing "breaking changes",
      with new functions using diffrent parameters or using parameters in different order. One of the column's on the sheet is used to store EAN13 (barcode) and was formatted like 1,23E12.
      I couldn't change the cell to text, also autofitwidt was not working and using conditional formatting was also a no-no.
      So in the end I could use the new Excel UDF, but not desapointed management.
       
      What would I like to ask?
      I understand that sometimes you want to rewrite a program to make it better. I even understand that one has to make breaking changes sometimes.
      But in this case because of lacking examples/resources my day went completely down the drain.
      I would like to ask the Excel.udf developpers to:
      Make more functions available to do things like changing cell properties easily, changing cell color, do an autofit columnwidth, format data conditionally. 
        Or write an Example using the (new) Excel UDF, making examples how to format a cell, do conditional format, changing cell colors etc.
        I probably am more of an example guy.
      Having a good Excel.UDF Example showing a lot of common things normally makes, programming things easy for me.
      Because I can keep tweaking snippets until I get it working the way I want it.
       
      So dear developpers, could you help me and other future user out?
       
       
       
       
       
       
       
       
       
       
       
       
       
       
×
×
  • Create New...