Jump to content

Recommended Posts

dany

AU3Text.au3 v1.0

An extensive UDF to ease the internationalization of AutoIt scripts and programs. Add multi-lingual support to your scripts and programs in a consistent and portable manner.

Main features:

  • Store messages in a human-readable INI format.
  • Organize messages in different categories.
  • Handle singular and plural string variants at run time.
  • Expands meta-characters and all AutoIt macro's.
  • Supports UTF-16 Little-Endian encoding.
  • GUI Menu and Combo Create/Read helper functions.
  • Command line utility to extract messages from AutoIt scripts.
  • Fully portable!
The download contains the following files:
ReadMe.txt                  Instructions and information on the UDF.
AU3Text-HowTo.txt           Step by step instructions to convert programs for
                            internationalization with AutoIt.
AU3Text-Demo.au3            AU3Text demo.
AU3Text-Extractor.au3       Source file for command line utility to extract
                            AU3Text messages from scripts. You'll need to compile
                            this script before you can use it. This is BETA software!
LibAU3Text.au3             Main AU3Text library.
LibAU3TextGUI.au3          AU3Text GUI helpers.
LibAU3TextDev.au3          Additional developer functions.
LibLocale.au3              Locale functions. Originally based on guinness'
                            excellent _GetOSLanguage function, but has grown into
                            a full stand-alone UDF.
LibIni.au3                 UTF-16 LE INI functions.
LibStringFormatEx.au3      Modified StringFormat function. See
                            http://www.autoitscript.com/forum/topic/139260-autoit-snippets/page__st__60#entry1010824
I18nAU3Text-Demo.en.lng    English demo language file.
I18nAU3Text-Demo.nl.lng    Dutch demo language file.
I18nAU3Text-Translation-HowTo.txt
                            Basic translation instructions.
ResAU3Text-Extractor.ico   Pic unrelated :)

A simple example of translating a string:

#include 'LibAU3Text.au3'
_AU3Text_BindTextSection('MESSAGES', 'nl') ; Set translations to dutch.
; ... Create a GUI.
; Translate a string:
GUICtrlCreateLabel(_AU3Text('The flying dutchman flies again.', 'FLYING_DUTCHMAN'), -1, -1) ; De vliegende hollander vliegt alweer.
; Translate a string with plural variants:
GUICtrlCreateLabel(StringFormat(_AU3Text_Plural('Deleted %i file.', 2, 'DELETED_FILES'), 2), -1, -1) ; 2 bestanden verwijdert.
; Using shorthand functions:
GUICtrlCreateLabel(_('The flying dutchman flies again.', 'FLYING_DUTCHMAN'), -1, -1)
GUICtrlCreateLabel(StringFormat(_P('Deleted %i file.', 2, 'DELETED_FILES'), 2), -1, -1)
; Let AU3Text generate the INI keys, keys are MD5 hashes of the messages.
GUICtrlCreateLabel(_('The flying dutchman flies again.'), -1, -1)
GUICtrlCreateLabel(StringFormat(_P('Deleted %i file.', 2), 2), -1, -1)
; ...

The UDF:

AU3Text.zip

If you encounter any bugs or have any suggestions, requests or improvements, then please let me know.

Happy coding!

edit 1: zip added

edit 2: If you compiled AU3Text-Extractor and want to test it, run it against AU3Text-Demo like this:

AU3Text-Extractor.exe Au3Text-Demo.au3 be

This will create AU3Text-Demo.be.lng in the I18n directory.

Edited by dany

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites
JackDinn

well quite a coincidence , iv just been asked if i can translate my speed tester app into French http://www.gmwsoftware.co.uk/guestbook.html

I was wondering how i might go about doing this as of course if i do it for French i really should do many of the other languages that use my software.

All i need to do now is hope i can figure out how your great looking AU3text works :-/

cool timing coincidence,

Many Many thx.


Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Share this post


Link to post
Share on other sites
dany

All i need to do now is hope i can figure out how your great looking AU3text works

Thanks for the compliment :) Just take a good look at the demo script. You'll figure it out, it isn't hard to set up. Post any questions or problems here if you have them!

edit: Included a How-To in the zip with instructions on how to prepare programs for internationalization with AutoIt.

Edited by dany

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites
MrCreatoR

Look at


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites
dany

Very impressive MrCreator. Mine is just a specialized little tool and I'm not planning on developing a GUI until I have a stable and bulletproof version 1 command line tool.

I'm looking through the code and it's very interesting. Yours is definitely a different approach from mine.

I ran ATT on AU3Text-Demo.au3. It found way too many strings but I can just use the regexp from AU3Text-Extractor to pick up the ones I want. That's pretty awesome. However, it didn't pick up the strings spread across multiple lines. I'll have to figure out a regex pattern for that. And I certainly didn't expect it to rewrite my script! He, lucky for me the script was open in notepad++ so I could undo it all.

Well, it's going to keep me busy for the next hour or so I bet. I'll post further comments in your thread. But I'll say it again, very impressive.


[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites
JackDinn

@dany

Thx for the PM, i had been reading your edits though. The help is appreciated :)

It looks like i made a major incorrect assumption in that i was hoping for something that would not just organize the language files and help implement them but i was looking for something that would actually do the translation to !

However after looking and gaining some understanding of how you have gone about using individual language files it did open my eyes as to how to go about the whole situation.

I have decided in the end that rather than use other peoples UDF's i would prefer to just keep it as simple as possible and also under my complete control (without parts that i just dont understand).

So what im going to do is replace all my text strings with a func ie _trans("text to translate") (which i would have to do anyhow).

Then when a $makeEnglishFile=1 var is set the _tras func would just create an English translation file.

So after changing all my strings in my code and setting the $makeEnglishFile=1 i would run my program and end up with an English language file. Iv decided on a very simple layout :-

some text,some text

Hello,Hello

More text,More text

text to translate,text to translate

etc etc.

then im thinking i can create a separate AI code to run through the English file and translate the whole thing for each language i need:-

some text,un texte

Hello,Bonjour

More text,Plus de texte

text to translate,texte à traduire

Now atm im using google translate desktop to do the actual translating, its a very simple gui that i can get AI to automate paste English in and retrieve whatever language i need out.

What would be really handy is an AI UDF that i could use really easily {ie. $TransOut=_translate_func("text to translate",lang) } to translate but iv not seen anything quite as simple as that, but im quite happy getting a 3rd party app to do it, id only need to use it once(ish) for each language.

So the final part of the procedure is after creating the individual language files i can turn off the $makeEnglishFile=0 and then on running my app it would read the correct language file into an array and it would then be easy for the _trans("text to translate") func to cross-ref the parsed in English string against the language array.

Well thats what im going to try anyhow. Im sure you chaps have already created all id really need but as i say reading and understanding other people code & how to use it can be a bit out of my league :-/ but i do really appreciate the methodology ,not sure id have thought of it any time soon , lol.

Cheers,

JD.


Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Share this post


Link to post
Share on other sites
dany

Basically, what you describe is also what I've done, save the translation part with Google Translate. Mmmh, could be a nice addition...

Anyway, good luck with your own project!


[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites
guinness

Nice idea. One point to make (having skimmed through the code) you don't need to declare $i in _GetOSLanguage for example. I also don't know if others had this problem but I used Tidy (Ctrl+T in SciTE) on your code as it was highlighting as one massive comment, due to alignment issues.

I also couldn't run the example due to the Au3 Script being encoded as 'UTF8 with BOM'.

Func _GetOSLanguage()
    ; Local $i
    For $i = 1 To $__Locale_aTable[0][0]
        If StringInStr($__Locale_aTable[$i][0], @OSLang) Then
            Return $__Locale_aTable[$i][3]
        EndIf
    Next
    Return SetError(1, $E_LOCALE_UNKNOWN_LANGUAGE, $__Locale_aTable[1][3])
EndFunc

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
guinness

But the demo did work in my case though .

Because you re-saved it. I fixed it at my end, but it's best issues like this get resolved now rather than 2 years down the line.

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
dany

Nice idea. One point to make (having skimmed through the code) you don't need to declare $i in _GetOSLanguage for example. I also don't know if others had this problem but I used Tidy (Ctrl+T in SciTE) on your code as it was highlighting as one massive comment, due to alignment issues.

I also couldn't run the example due to the Au3 Script being encoded as 'UTF8 with BOM'.

Ah yes, I'm in the habit of declaring all variables because that's best practise in PHP. But is this an AutoIt issue or something to do with the wrappers and Tidy? Either way, I'll do some code cleaning.

Also, what IS the best format to save my scripts then? I couldn't reproduce your error so I'm curious as to why that would happen...

Edited by dany

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites
dany

Based on guinness' comment I've updated the zip:

  • Removed all declarations of Local $i and let autoit handle scoping etc.
  • Removed a few other stray unused variables I came across.
  • Changed the encoding of all files to UTF-16 LE. That should be best.
  • Lastly, fixed a small bug in both _AU3Text_Plural and _AU3Text_SectionPlural, now plural forms should be picked up correctly.

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Share this post


Link to post
Share on other sites
guinness

[*]Removed all declarations of Local $i and let autoit handle scoping etc.

If only used in a For loop then there is no need to declare it.

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
dany

That's the only place I use $i, $ii etc. i as in incrementer. Admittedly not very descriptive but since it's the only place I use one-letter variables always easy to spot.

Edited by dany

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

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

  • Similar Content

    • TheSaint
      By TheSaint
      Here is the bare bones of a UDF I have started work on.
      Mostly just a proof of concept at this stage, and still need to add some functions and dress the UDF up a bit ... to look like a UDF ... though it has my own distinct styling, especially as I have never really developed a UDF before now .... used plenty and modified plenty though. I've even invented my own UDF variable naming convention, which I am sure some of you will be aghast at. I work with what feels best for me, but others are free to adapt if they wish.
      The idea is to emulate the simplicity of INI files, but gain the benefits of SQL.
      Two scripts are provided.
      (1) The UDF, a work in progress - SimpleSQL_UDF.au3
      (2) An example or testing script - UDF_Test.au3
      Another first for me, is creating a 2D array from scratch, never done that before, that I can recall ... never had a need, and even for 1 dimension arrays, for a long time now, I have just used _StringSplit to create them. So I needed a bit of a refresher course, which my good buddy @TheDcoder assisted me with ... not without some angst I might add. LOL
      SimpleSQL_UDF.zip
      Program requires the sqlite3.dll, not included, but easily enough obtained.
      Hopefully the usage is self-evident ... just change the Job number variable in the UDF_Test.au3 file to check the existing functions out.
      Enjoy!
      P.S. This is also related to a new program I have just finished and uploaded - INItoSQL DB
    • nacerbaaziz
      By nacerbaaziz
      hi dears
      am using an ini files as a History
      Sometimes the file size is be larger to 5 MB
      AutoIt does not recognize the full content of the file
      When I did a search to find out why, I discovered that INI files could not be read if they size larger than 64 KB.
      for that I preferred to ask here if is there any way to bypass this obstacle.
      The contents of the file are  as follows
      [filesList]
      c:\...\...\f1.mp3=00:15:20
      c:\...\...\f2.mp3=00:10:20
      c:\...\...\f3.wav=00:59:20
      ....... Etc
      This is the section for reading the file (adapted from my main script)

      case $continue     Local $aArray = IniReadSection($WaitingListFile, StringEncrypt(true, "filesList", $MyPassword))     If Not @error Then Opt("GUICloseOnESC", 1) _GUICtrlListView_DeleteAllItems($scList)         For $i = 1 To $aArray[0][0] $path = path_list(StringEncrypt(false, $aArray[$i][0], $MyPassWord), 1) if FileExists(StringEncrypt(false, $aArray[$i][0], $MyPassWord)) then GUICtrlCreateListViewItem(_GetFileName(FileGetLongName(StringEncrypt(false, $aArray[$i][0], $MyPassWord))) & Opt("GUIDataSeparatorChar") & " : " & Opt("GUIDataSeparatorChar") & FileGetLongName(StringEncrypt(false, $aArray[$i][0], $MyPassWord)), $scList) else $path = $path endIf         Next GUISetState(@sw_disable, $hGUI) GUISetState(@sw_show, $hGUI2) GUICtrlSetState($SClist, $GUI_FOCUS) else if $accessibilitymode = 1 then speak(str("listEmpty")) endIf endIf
      Is there any way to solve this problem, please?
      am waiting your answers...
      Greetings to All
    • Rskm
      By Rskm
      Hi, I have the following line in a text file 'input.txt'. I know the line number - say '6'. I wish to replace the text 'WWW' in the below line with a random number (I can generate that with random()).
      WERIS  WWWJP   3.83  8.330  1.000                1097.RAXX 
      The WWW is a 3 digit integer (could be any number between 0 to 999), I can use stringtrimleft and get the numerical value of WWW in this file
      so, basically, I know the string to replace (ie; WWW stored in a variable), I know the line number to work on and the file location/name and the replacement variable (through random()). My requirement is to fill that 3 spaces with my random number (which Is a integer between 1 and 999)
      please put ur suggestions
       
    • AndreasNWWWWW
      By AndreasNWWWWW
      Hi, i'm just curious is there a way to sort an ini file after largest first?
      my inifiles writes itself like this
      14=500
      13=GREY
      12=500
      11=600
      10=600
      9=600
      8=700
      7=700
      5=600
      3=600
      2=800
      1=700
      15=GREY
      4=GREY
       
      but is there a way so i can get it sortet 
      15
      14
      13
      12 
      etc?
    • xtcislove
      By xtcislove
      Hello,
      as a start in Autoit i tried something i was missing since im using Autoit. 

      I build a custom MessageBox which has a large amount of custom options and which scales its size on the parameters you set. 

      Aviable Settings:
      -Title
      -Unlimited Buttons
      -Text Color (Buttons, Text)

      -Background Color (Msgbox, Buttons, Label) 

      -Button Timeout
      -Autoclose Timeout
      -Icon (Default, No Icon, Custom)

      -Label/ Button Style. 
      -Transparency

      I tried to keep this as close as i could to a Msgbox i was used too on my batch times.

      After i was ready i realised, @Melba23 probably build a way better msgbox which would have suit my needs enterly, anyway thanks to @Melba23 because i use his Stringsize UDF. 

       
       
      local $Message = _sMsgBox("Test", 6, "Continue?") if @extended <> -1 Then MsgBox(0, @extended, $Message&" Button pressed")  
      ScalingMessageBox.au3
×