Getting this error :
(22) : ==> Variable used without being declared.: if $vNumber = 0 Then if ^ ERROR
But I'm sure I have defined the variable, as in the top of my script has
Global $vNumber = 0
How would I go about fixing this?
Hi all, I wasnt active in this Forum forum for Years. 😅
Since I need something with Json in AutoIt i write a little UDF to save a variable to file to read it with another language - and back. After a while until my other script grows i thought - lets integrate all variables wich is possible, because i want have arrays to.
This is my first public UDF in Autoit - normaly my AutoIt scripts are quick an dirty.... - like the examples for this udf. - someone want to write nice examples?
I tried to write this UDF properly, cared for processing speed, low mem consumption as possible, a short code, and a high usability without beeing very familiar with arrays.
What is it for? - convert nearly all types of variables to a json string for saving it in a file or to an ini. Read it back in to a same formated variable and preserv variable types. All array types are supported with nested arrays, the only restriction is ram and array/stringsize - and time if the array is very big. You can use Filters for variable types and some other options.
If anyone found a bug or any suggestions, please post it.
get Json.au3 from here Json.au3
This topic give you access to an AutoIt functions library I maintain which is called PAL, Peter's AutoIt Library. The latest version 1.19 contains 194 functions divided into these topics:
window and screen mouse and GUI GUI controls logics and mathematics string, xml string and file string dialogues and progress bars data lists: lists, stacks, shift registers and key maps (a.ka. dictionaries) miscellaneous: logging/debugging, process and system info A lot of these functions were created in the development of Peace, Peter's Equalizer APO Configuration Extension, which is a user interface for the system-wide audio driver called Equalizer APO.
Hi, i have a source code of "Danny35d" and i have 2 main question that are:
How to extract this function's results (Datas are as Array) to combo-box without set number of datas? When i type 1, 2 in _SystemUsers($AccountType = 0) to get only Local or Domain users, it just give me both of them, it's old problem of this function, please share us debugged code :)❤ #include <Array.au3> $Users = _ArrayToString(_SystemUsers(), "|", 1) ConsoleWrite($Users & @CRLF) #cs =============================================================================== Function: _SystemUsers($AccountType = 0) Description: Return an array with the local or domain username Parameter(s): $AccountType: Local, domain or both username 0 = Local and Domain usernames 1 = Local usernames only 2 = Domain usernames only Returns: An array with the list of usernames - Succeeded @error 1 - Didn't query any username @error 2 - Failed to create Win32_SystemUsers object @error 3 - Invalid $AccountType Author(s): Danny35d #ce =============================================================================== Func _SystemUsers($AccountType = 0) Local $aSystemUsers Local $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20 Local $colItems = "", $strComputer = "localhost" If Not StringRegExp($AccountType, '') Then Return SetError(3, 3, '') $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_SystemUsers", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems $Output = StringSplit($objItem.PartComponent, ',') If IsArray($Output) Then $Temp = StringReplace(StringTrimLeft($Output, StringInStr($Output, '=', 0, -1)), '"', '') If $AccountType = 0 Or ($AccountType = 1 And @ComputerName = $Temp) Then $aSystemUsers &= StringReplace(StringTrimLeft($Output, StringInStr($Output, '=', 0, -1)), '"', '') & '|' ElseIf $AccountType = 2 And @ComputerName <> $Temp Then $aSystemUsers &= StringReplace(StringTrimLeft($Output, StringInStr($Output, '=', 0, -1)), '"', '') & '|' EndIf EndIf Next $aSystemUsers = StringTrimRight($aSystemUsers, 1) If $aSystemUsers = '' Then Return(SetError(1, 1, $aSystemUsers)) Return(SetError(0, 0, StringSplit($aSystemUsers, '|'))) Else $aSystemUsers = '' Return(SetError(2, 2, $aSystemUsers)) EndIf EndFunc ;==>_SystemUsers Thanks to your best Team.
This is my very first post in this forum and am also new with Autoit programming so be easy on me.
Below is the code that I am trying to get the index of the item selected. No problem getting the text.
Case $listEdition ; handle of the list local $index=0 $item=GUICTRLRead($listEdition) ; This will return the text in the list ; ============== The loop below always fails ================== ; Meaning _GUICtrlListView_GetItemSelected($listEdition, $i) always return FALSE. WHY ??????? For $i = 0 To $editionArray - 1 ; The content of the list in an array where editionArray contains total count of items If _GUICtrlListView_GetItemSelected($listEdition, $i) Then $index = $i exitloop EndIf Next ;=================================================== ConsoleWrite( "Select Edition: " & $item & " index: " & $index & @CR) ....... Please look at the comments in the code & the pix attached.
_GUICtrlListView_GetItemSelected($listEdition, $i) always returns FALSE.
Another problem is on the list. It also populate the total count of items from the Array. How can I skip this item from populating to the list ?.
Please advise and thanks