Leaderboard
Popular Content
Showing content with the highest reputation on 02/06/2025 in all areas
-
BETA: SciTE v5x & lua Dynamic_include and "Smart" AutoComplete for Vars/UDFs/Abbrevs
argumentum and 4 others reacted to Jos for a topic
I am getting ready to publish a production update for SciTE4AutoI3, so have a SciTE4AutoIt3 v25.205.1420.0 release candidate ready and uploaded to Beta for those willing to test this installer before releasing it. Would appreciate hearing whether there are still issues with it as it has been a major overhaul since the last production version back in 2021. My main drives at this moment are to get the setup ready for better supporting Visual Studio Code as the default editor for AutoIt3, as I am convinced that there is an added benefit using VSC over SciTE. I have no intent to drop the SciTE upgrades, but do prefer to stop development & support of all the written LUA script functionalities. This is a list of the current changes at a high level: SciTE updated from v4.4.6 to v5.5.4 and includes both the x86 and x64 version selectable at install time Include the major LUA changes for Dynamic add Variables & Functions & #Include functionality. See here for details. This can be Simply disabled when old behavior is preferred by settings dynamic.include=n Utilities (Tidy.exe/au3Stripper/Au3check) can now process mixed encoded files and special characters in the filenames, so they do not require AutoIt3Wrappper anymore. The Included au3check v3.3.17.1 is an update of the standard latest au3check v3.3.16.1 included in the AutoIt3 installer. The new au3check now also supports mixed encoded files and special characters in the filenames and can be used without AutoIt3Wrapper for those cases. The installer will check the current version and replace it with this version when it is < v3.3.17.1. A copy of the old version will be made to AutoIt3\SciTE\Au3Check The installer will prompt for SciTE.exe x86 or x64 version Whether you want to change to VSCode as your default Editor for the "Edit" & "Open" options for AU3 files. What to do with Double Click, either Open or Run with AutoIt3. (also an option to change in SciTE Config) For those few that are currently using the Dynamic Beta version: There are a few minor changes since the last version published: AutoComplete #include lines wasn't working when dynamic.include=n was set. I have added the option to limited the number of entries shown in the AutoComplete dropdown to make it much more responsive when e.g. typing $a : # Define the max entries is a Variable/Func dropdown autocomplete list for speed reasons. autocomplete_dropdown_max=2005 points -
Visual Studio Code Extension currently available and future plans for SciTE?
donnyh13 and 2 others reacted to argumentum for a topic
...at times ( quite often ), I do disagree with the better angels of my nature and, pay the price 😠But, 60 years later am slowly identifying the pattern and can say, that am starting to be more mindful of the advisor. If I continue paying good attention, I figure I'll be wise at about the age of 1203 points -
Visual Studio Code Extension currently available and future plans for SciTE?
SOLVE-SMART and one other reacted to ValentinM for a topic
The power of VS Code is in extensions. You want bookmarks ? Install Bookmarks. Or maybe you would like a "session" system just like in SciTE ? Install Save and restore tabs. You also can open .csv files, and color them with Rainbow CSV for a better reading experience, or even use Git(hub/lab) straight into it. Copilot can help too, and since it reads your open files, we have to admit that it works pretty well. These are some extensions I am using, I hope it will be useful for someone.2 points -
Verify Username and Email Address
SOLVE-SMART reacted to seadoggie01 for a topic
We do have MS 365 and Graph API is exactly what I was looking for, it seems. I found Get-MgUser (Microsoft.Graph.Users) | Microsoft Learn from a few searches and that's working in PowerShell. (This also lead me in to a weird rabbit hole of exploring MS Entra and possibly solving an unrelated problem.) I'll post back here when I have something that's a more complete answer to this.1 point -
Registry Function Scripts
mr-es335 reacted to SOLVE-SMART for a topic
Hi @mr-es335 👋 , the @error marco refers to the command before. This means the function RegWrite() could came up with an error (see the help for better understanding). So this error check is valid and good practise. You can also avoid this: If @error = 1 Then by using simply this: If @error Then My quick suggestion would look like this: #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y AddRegKeyHKCUValue() Func AddRegKeyHKCUValue() Local $sKeyname = "HKEY_CURRENT_USER\Software\Native Instruments\Guitar Rig 5" Local $sValuename = "UserContent" Local $sRegSZ = "REG_SZ" Local $sString = "C:\Program Files\Native Instruments\Reflektor\16 User_Impulses\" RegWrite($sKeyname, $sValuename, $sRegSZ, $sString) If @error Then SplashTextOn("NOTICE!!", "The HKCU valuename and string WAS NOT successfully added!", 800, 50, -1, -1) Sleep(2000) SplashOff() Return EndIf SplashTextOn("NOTICE!!", "The HKCU valuename and string WAS successfully added!", 800, 50, -1, -1) Sleep(2000) SplashOff() EndFunc No necessity for if-else when you simple can return early. This concept avoid nesting and potential error prone code can not be entered because the code returns early. Best regards Sven1 point -
Limit on COM interaction with MS Word
SOLVE-SMART reacted to Nine for a topic
Old PC, old OS, old AutoIt, old Office. Maybe the Bits&Bytes God is trying to tell you something1 point -
Visual Studio Code Extension currently available and future plans for SciTE?
argumentum reacted to SOLVE-SMART for a topic
1 point -
Visual Studio Code Extension currently available and future plans for SciTE?
SOLVE-SMART reacted to argumentum for a topic
WOW. The world of VSCode !. I don't think AI can summarize it. ..and if it did, it would be a no-answer. Am now getting an idea, ( faint idea, ) of the issue with extensions. Haven't look into extensions code yet, just extensions. For the type of .., pain in the ass ?, that I am, ..I'd become a VSCode coder, just to use it in a way that I feel at home with having what can be had. But then I would not code my project because I would get lost in an extension or another of my fancy - 3) How do I set bookmarks ? ( F2 , Ctrl + F2 in SciTE ) .. add an extension, remap the key association and feel at home again. I guess I'll wait for y'all to settle on something ( extensions wise ) because, I spoke with my psychologist ( just me advising me ) and ( I myself ) told me to stay away from new stuff too involved for my attention span. And I agree with me. I have stuff I never finished because of this nature of mine. 🙄 So I'll watch from the sidelines the game development of the AutoIt extension adventure1 point -
Visual Studio Code Extension currently available and future plans for SciTE?
argumentum reacted to SOLVE-SMART for a topic
@argumentum It's not easy to answer you questions without having to explain intentions around VSCode, the extension ecosystem and so on (at least for me). I hope you will get a better answers by other persons here, but my suggestion is to walk through https://code.visualstudio.com/api/get-started/your-first-extension , watch some tutorials/docs or even ask AI to summarize it (because it's mainly a non strict related AutoIt topic). Or maybe we open another Thread for "VSCode and VSCode extension fundamentals" 🤔 😀 ? Best regards Sven1 point -
Visual Studio Code Extension currently available and future plans for SciTE?
SOLVE-SMART reacted to argumentum for a topic
it ain't that different for me ..the keymapping is different but pretty much the same. ...so many questions. 1) When I install an extension (, and I installed both ), which one is the one responding/acting on the action ?, I press "Ctrl + F7", who did it ? 2) I mapped "Ctrl + Alt + T" for Tidy. What did I just mapped ?, why does it work ? 3) How do I set bookmarks ? ( F2 , Ctrl + F2 in SciTE ) Please answer in a way a single threaded brain would understand1 point -
Visual Studio Code Extension currently available and future plans for SciTE?
SOLVE-SMART reacted to genius257 for a topic
That is tough for me to answer clearly. I am always 100% open for discussions, suggestions and feedback. For contributions in regards to my code, i am torn. My code is mostly very unorganized, and currently no automatic linting or general contribution guidelines exists. This means that bigger code contributions will have a lot of unnecessary back and forth, because currently it's all on my local setup and in my head (more or less). Of course I want to welcome anyone to contribute, but without the issues mentioned above is fixed, I'd advise would be contributors to start with an issue, describing the wanted fix/feature first, before implementing something that may end up being discarded (A waste of work would be bad for you and sad for me). But via conversations, and an agreed direction, leading to pull request, i see no issue in getting more people involved I do have big wants for the future of my extension, but am stuck in a lot of experimental and exploratory development, making a concrete vision problematic 😅1 point -
This UDF is one of my most often used at work. I use Autoit to automate our Windows PC build process, and much of what I need to do is based around Active Directory. I've written scripts to unexpire and reset passwords, join a computer to the domain and rename it, remove old computers from the domain, check to see whether a user is in a specific AD group, grab a list of users from AD to assign new computers to, add users to groups, etc. Everything centers around this wonderful UDF. If you're a Windows domain administrator who uses scripting to make your life easier, you absolutely need this code. The functions in the UDF are well documented, and there are lots of examples to show how things work. Highly recommend. Thank you Water for all the time and effort you put into this!1 point
-
Visual Studio Code Extension currently available and future plans for SciTE?
seadoggie01 reacted to Jos for a topic
Let's not make this topic more difficult than it is and stick for now to VSCode/SciTE. One can always decide to go down an alternative path later when VSCode is working.1 point -
Here another way based on relative pixel location from the first (left/top most) pixel using my ScreenScraping UDF. Coordinates are screen absolute location. #include "C:\Apps\AutoIt\GetScreen\GetScreen.au3" #include <Color.au3> Local $hWnd = WinActivate("Microsoft Office Picture Manager") WinWaitActive($hWnd) Global Const $LINE = 423, $COLUMN = 550, $ENDX = 690, $ENDY = 465, $NDIGIT = 4 Global $aDigit = DefineNum() _GetScreen_Initialize($ENDX, $ENDY) Local $hTimer = TimerInit() _GetScreen_GetScreen() Local $iPos = $COLUMN, $vValue For $i = 1 To $NDIGIT $vValue &= GetDigit($iPos) $iPos = @extended Next ConsoleWrite($vValue & @CRLF) ConsoleWrite(TimerDiff($hTimer) & @CRLF) Func GetDigit($iStart) Local $aTmp For $i = $iStart To $ENDX If IsColor(_GetScreen_GetPixel($i, $LINE)) Then For $j = 0 To UBound($aDigit) - 1 $aTmp = $aDigit[$j][2] For $k = 0 To UBound($aTmp) - 1 If Not IsColor(_GetScreen_GetPixel($i + $aTmp[$k][0], $LINE + $aTmp[$k][1])) Then ContinueLoop 2 Next Return SetExtended($i + $aDigit[$j][1], $aDigit[$j][0]) Next ConsoleWrite("error" & @CRLF) Return SetError(1) EndIf Next EndFunc ;==>GetDigit Func DefineNum() Local $aNum[10][3] = [[0, 14, 0], [1, 4, 0], [2, 14, 0], [8, 14, 0], [3, 14, 0], [5, 24, 0], [7, 24, 0], [4, 4, 0], [9, 24, 0], [6, 10, 0]] Local $aTmp = [[13, 15], [-3, 20], [9, 10]] ; 0 $aNum[0][2] = $aTmp Local $aTmp = [[-1, 10], [-2, 15], [-9, 30]] ; 1 $aNum[1][2] = $aTmp Local $aTmp = [[-3, 20], [-9, 30], [11, 30]] ; 2 $aNum[2][2] = $aTmp Local $aTmp = [[-4, 10], [-8, 20], [-2, 15]] ; 8 $aNum[3][2] = $aTmp Local $aTmp = [[8, 15], [3, 15], [-6, 5], [11, 25]] ; 3 $aNum[4][2] = $aTmp Local $aTmp = [[20, 0], [4, 10], [9, 10]] ; 5 $aNum[5][2] = $aTmp Local $aTmp = [[20, 0], [19, 5], [2, 20]] ; 7 $aNum[6][2] = $aTmp Local $aTmp = [[2, 20], [-18, 20], [-4, 25]] ; 4 $aNum[7][2] = $aTmp Local $aTmp = [[-6, 10], [-2, 15], [6, 25]] ; 9 $aNum[8][2] = $aTmp Local $aTmp = [[-12, 15], [-14, 25], [6, 25]] ; 6 $aNum[9][2] = $aTmp Return $aNum EndFunc ;==>DefineNum Func IsColor($nColor) Return Not _ColorGetRed($nColor) And Not _ColorGetBlue($nColor) And _ColorGetGreen($nColor) > Dec("FA") EndFunc $LINE must be the first line (top most) where the bright green color appears $COLUMN can be located somewhere before $ENDX can be anywhere right after the 4 digits $ENDY can be anywhere below under the 4 digits Tested on your 4 pics and it is working fine (and quite fast under 40ms)1 point
-
Some examples where the first digit is 1, preferable 10 images where all 0 through 9 is the first digit, now that they are cursive. The loop probably wont be as simple as in the old thread, but need the images to be sure.1 point
-
I enhanced the script of my first answer. Based on that you can see the patterns and identify the differences between the numbers 0-9 It depends if your are "reading" bitblt from the screen you should basically iterate per character. If you save them all as png files its like the given script needs to be enhanced and add the pattern later onwards.1 point
-
You should get some output like below, copy pasted to a texteditor (replaced 0 with a dot) you can find out the width of the numbers somewhere around 28 (depending on your colordepth) .x................................................................................................................................................................................ .x....................................................BBB.....................BBB..BBB................BBB..BBB..BBB.....................BBB....................................... .x...................................................B222B...................B222BB222B..............B222BB222BB222B...................B222B...................................... .x...................................................B222B...................B222BB222B..............B222BB222BB222B...................B222B...................................... .x....................................................BBB.....................BBB..BBB................BBB..BBB..BBB.....................BBB....................................... .x................................................................................................................................................................................ .x..............................................BBB..BBB................BBB.....................BBB.................BBB...........BBB..BBB........................................ .x.............................................B222BB222B..............B222B...................B222B...............B222B.........B222BB222B....................................... .x.............................................B222BB222B..............B222B...................B222B...............B222B.........B222BB222B....................................... .x..............................................BBB..BBB................BBB.....................BBB.................BBB...........BBB..BBB........................................ .x................................................................................................................................................................................ .x.........................................BBB.......BBB...........BBB..........................BBB.................BBB................BBB........................................ .x........................................B222B.....B222B.........B222B........................B222B...............B222B..............B222B....................................... .x........................................B222B.....B222B.........B222B........................B222B...............B222B..............B222B....................................... .x.........................................BBB.......BBB...........BBB..........................BBB.................BBB................BBB........................................ .x................................................................................................................................................................................ .x...................................BBB............BBB...........BBB..BBB..BBB..BBB................BBB..BBB..BBB..BBB................BBB......................................... .x..................................B222B..........B222B.........B222BB222BB222BB222B..............B222BB222BB222BB222B..............B222B........................................ .x..................................B222B..........B222B.........B222BB222BB222BB222B..............B222BB222BB222BB222B..............B222B........................................ .x...................................BBB............BBB...........BBB..BBB..BBB..BBB................BBB..BBB..BBB..BBB................BBB......................................... .x................................................................................................................................................................................ .x..................................BBB..BBB..BBB..BBB..BBB......BBB.................BBB..........................BBB................BBB.......................................... .x.................................B222BB222BB222BB222BB222B....B222B...............B222B........................B222B..............B222B......................................... .x.................................B222BB222BB222BB222BB222B....B222B...............B222B........................B222B..............B222B......................................... .x..................................BBB..BBB..BBB..BBB..BBB......BBB.................BBB..........................BBB................BBB.......................................... .x................................................................................................................................................................................ .x................................................BBB...........BBB.................BBB.....................BBB.....................BBB........................................... .x...............................................B222B.........B222B...............B222B...................B222B...................B222B.......................................... .x...............................................B222B.........B222B...............B222B...................B222B...................B222B.......................................... .x................................................BBB...........BBB.................BBB.....................BBB.....................BBB........................................... .x................................................................................................................................................................................ .x................................................BBB................BBB..BBB..BBB................BBB..BBB.....................BBB..BBB..BBB...................................... .x...............................................B222B..............B222BB222BB222B..............B222BB222B...................B222BB222BB222B..................................... .x...............................................B222B..............B222BB222BB222B..............B222BB222B...................B222BB222BB222B..................................... .x................................................BBB................BBB..BBB..BBB................BBB..BBB.....................BBB..BBB..BBB......................................1 point
-
Maybe this helps a little in understanding. Its just manipulation of pixels in a certan layout (PNG). Look at the output and zoom in/out, you can see almost the numbers yourself #Region includes Opt('MustDeclareVars', 1) ;#include <GUIConstants.au3> #include <GDIPlus.au3> #Include <ScreenCapture.au3> #include <string.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #EndRegion _GDIPlus_Startup() Dim $BitmapFilename Dim $BMPData="", $BMPWidth=0, $BMPHeight=0, $BMPLineWidth=0, $imgBytes=1 dim $binaryLine for $i=1 to 4 $BitmapFilename = @TempDir & "\" & "pic" & string($i) & ".png" $BMPData="" $BMPWidth=0 $BMPHeight=0 $BMPLineWidth=0 $imgBytes=1 consolewrite($bitmapFileName) ; Load the bitmap to find getImage($BitmapFilename, $BMPData, $BMPWidth, $BMPHeight, $BMPLineWidth, $imgBytes) ;~ See the height and width and dump the data on screen consolewrite($BMPHeight & " ; ") consolewrite($BMPWidth &@CRLF ) consolewrite("0 1 2 3 4 5 6 7 8 9 x x x x " & @CRLF) consolewrite("01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & @CRLF) For $iLine = 11 To $BMPHeight-12 ;~ From the screenshots we can ignore the first 16 bytes (remember in text its 2 characters ;~ $binaryLine=BinaryMid($bmp1Data,($i*$BMP1LineWidth)+16,$BMP1LineWidth) ;~ and we only need 4 digits which takes about 28 characters and 1 character separator = $binaryLine=BinaryMid($bmpData,($iLine *$BMPLineWidth)+16,60) ;~ Lets make it readable $binaryLine=StringReplace($binaryLine,"0",".") consolewrite($iLine & " : " & $binaryLine & @CRLF) next ;~ lets recognise for $iNumber=1 to 4 consolewrite(@crlf) consolewrite("0 1 2 3 4 5 6 7 8 9 x x x x " & @CRLF) consolewrite("01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" & @CRLF) For $iLine = 11 To $BMPHeight-12 $binaryLine=BinaryMid($bmpData,($iLine *$BMPLineWidth)+16+(($iNumber-1)*15),14) $binaryLine=StringReplace($binaryLine,"0",".") consolewrite($iLine & " : " & $binaryLine & @CRLF) next Next Next _GDIPlus_Shutdown() Func GetImage($BMPFile, byref $BMPDataStart, byref $Width, byRef $Height, byref $Stride, $imgBytes=3) local $Scan0, $pixelData, $hbScreen, $pBitmap, $pBitmapCap, $handle, $bitMapdata, $pixelFormat ; Load the bitmap to search in If $BMPFile="SCREEN" Then $hbScreen=_ScreenCapture_Capture("",0,0,-1,-1,False) $pBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hbScreen); returns memory bitmap Else ;try to get a handle $handle = WinGetHandle($BMPFile) If @error Then ;Assume its an unknown handle so correct filename should be given $pBitmap = _GDIPlus_BitmapCreateFromFile($BMPFile) ;~ $hBitmap = _GDIPlus_ImageLoadFromFile($BMPFile) Else $hbScreen=_ScreenCapture_CaptureWnd("",$handle,0,0,-1,-1,False) $pBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hbScreen); returns memory bitmap EndIf EndIf ;Get $tagGDIPBITMAPDATA structure ConsoleWrite("Bitmap Width: " & _GDIPlus_ImageGetWidth($pBitmap) & @CRLF ) ConsoleWrite("Bitmap Height: " & _GDIPlus_ImageGetHeight($pBitmap) & @CRLF) ;~ 24 bits (3 bytes) or 16 bits (2 bytes) comparison if ($imgBytes=1) then $BitmapData= _GDIPlus_BitmapLockBits($pBitmap, 0, 0, _GDIPlus_ImageGetWidth($pBitmap), _GDIPlus_ImageGetHeight($pBitmap), $GDIP_ILMREAD, $GDIP_PXF04INDEXED) Endif if ($imgBytes=2) then $BitmapData= _GDIPlus_BitmapLockBits($pBitmap, 0, 0, _GDIPlus_ImageGetWidth($pBitmap), _GDIPlus_ImageGetHeight($pBitmap), $GDIP_ILMREAD, $GDIP_PXF16RGB555) ;~ $BitmapData= _GDIPlus_BitmapLockBits($pBitmap, 0, 0, _GDIPlus_ImageGetWidth($pBitmap), _GDIPlus_ImageGetHeight($pBitmap), $GDIP_ILMREAD, $GDIP_PXF32ARGB) EndIf if ($imgBytes=3) then $BitmapData= _GDIPlus_BitmapLockBits($pBitmap, 0, 0, _GDIPlus_ImageGetWidth($pBitmap), _GDIPlus_ImageGetHeight($pBitmap), $GDIP_ILMREAD, $GDIP_PXF24RGB) ;~ $BitmapData= _GDIPlus_BitmapLockBits($pBitmap, 0, 0, _GDIPlus_ImageGetWidth($pBitmap), _GDIPlus_ImageGetHeight($pBitmap), $GDIP_ILMREAD, $GDIP_PXF32ARGB) endIf If @ERROR Then MsgBox(0,"","Error locking region " & @error) $Stride = DllStructGetData($BitmapData, "Stride");Stride - Offset, in bytes, between consecutive scan lines of the bitmap. If the stride is positive, the bitmap is top-down. If the stride is negative, the bitmap is bottom-up. $Width = DllStructGetData($BitmapData, "Width");Image width - Number of pixels in one scan line of the bitmap. $Height = DllStructGetData($BitmapData, "Height");Image height - Number of scan lines in the bitmap. $PixelFormat = DllStructGetData($BitmapData, "PixelFormat");Pixel format - Integer that specifies the pixel format of the bitmap $Scan0 = DllStructGetData($BitmapData, "Scan0");Scan0 - Pointer to the first (index 0) scan line of the bitmap. $pixelData = DllStructCreate("ubyte lData[" & (abs($Stride) * $Height-1) & "]", $Scan0) $BMPDataStart = $BMPDataStart & DllStructGetData($pixeldata,"lData") _GDIPlus_BitmapUnlockBits($pBitmap, $BitmapData) _GDIPlus_ImageDispose ($pBitmap) _WinAPI_DeleteObject ($pBitmap) EndFunc;==>GetImage ; Draw rectangle on screen. Func _UIA_DrawRect($tLeft, $tRight, $tTop, $tBottom, $color = 0xFF, $PenWidth = 4) Local $hDC, $hPen, $obj_orig, $x1, $x2, $y1, $y2 $x1 = $tLeft $x2 = $tRight $y1 = $tTop $y2 = $tBottom $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop) $hPen = _WinAPI_CreatePen($PS_SOLID, $PenWidth, $color) $obj_orig = _WinAPI_SelectObject($hDC, $hPen) _WinAPI_DrawLine($hDC, $x1, $y1, $x2, $y1) ; horizontal to right _WinAPI_DrawLine($hDC, $x2, $y1, $x2, $y2) ; vertical down on right _WinAPI_DrawLine($hDC, $x2, $y2, $x1, $y2) ; horizontal to left right _WinAPI_DrawLine($hDC, $x1, $y2, $x1, $y1) ; vertical up on left ; clear resources _WinAPI_SelectObject($hDC, $obj_orig) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC(0, $hDC) EndFunc ;==>_UIA_DrawRect #EndRegion I assume you refer to1 point
-
OOo/LibO Calc UDF
GMK reacted to rohmanabdur for a topic
A newbie to AutoIt here.. I just want to thank @GMK for this awesome UDF. Absolutely amazing and inspiring.1 point -
Here is a simple function to return either an array sorted on the FT.. Flags or Filename #include <Array.au3> #include <File.au3> Local $sLatestFileCreated = _FileVersion(@MyDocumentsDir, "*.xlsx", 1, False) MsgBox(64, "Latest Created File Version", $sLatestFileCreated) Local $aLatestFileCreated = _FileVersion(@MyDocumentsDir, "*.xlsx", 1, True) _ArrayDisplay($aLatestFileCreated) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileVersion ; Description ...: ; Syntax ........: _FileVersion($sFilePath[, $sMask = "*.*"[, $iFlag = 0[, $bFormat = True]]]) ; Parameters ....: $sFilePath - Folder Path to Search ; $sMask - [optional] File Mask. Default is "*.*". ; $iFlag - [optional] Flag to indicate which timestamp ; - $FT_MODIFIED (0) = Last modified (default) ; - $FT_CREATED (1) = Created ; - $FT_ACCESSED (2) = Last accessed ; $bFormat - [optional] To specify type of return ; - True = Retrun an Array (default) ; - False = Return latest Filename for iFlag Type ; Return values .: An array or string ; Author ........: Subz ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _FileVersion($sFilePath, $sMask = "*.*", $iFlag = 0, $bFormat = True) Local $aFileList = _FileListToArrayRec($sFilePath, $sMask, 1, 0, 0, 2) If @error Then Return 0 Local $aFileVersion[0][4] _ArrayAdd($aFileVersion, UBound($aFileList) - 1 & "|Modified|Created|Accessed") For $i = 1 to $aFileList[0] _ArrayAdd($aFileVersion, $aFileList[$i] & "|" & FileGetTime($aFileList[$i], 0, 1) & "|" & FileGetTime($aFileList[$i], 1, 1) & "|" & FileGetTime($aFileList[$i], 2, 1)) Next Switch $iFlag Case 1 _ArraySort($aFileVersion, 1, 1, 0, 2) Case 2 _ArraySort($aFileVersion, 1, 1, 0, 3) Case Else _ArraySort($aFileVersion, 1, 1, 0, 1) EndSwitch Return $bFormat = True ? $aFileVersion : $aFileVersion[1][0] EndFunc1 point
-
I don't understand what's so hard to grasp: RegRead('HKLM\Software\Blah','') If @error = 1 Then Msgbox(0, 'Error', 'Key "HKLM\Software\Blah" not found.')1 point