Sign in to follow this  
Followers 0
Akarillon

Undefined variable

7 posts in this topic

Cant get the $i and $ii to work with the $Label and $Input variables.

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=c:\temp\Inventory_Server.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseX64=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Process.au3>
#include <WinAPI.au3>
#include <Date.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Inventory Viewer", 523, 523, 238, 143)
$Input1x = GUICtrlCreateInput("", 128, 72, 121, 21)
$Input2x = GUICtrlCreateInput("", 128, 96, 121, 21)
$Input3x = GUICtrlCreateInput("", 128, 120, 121, 21)
$Input4x = GUICtrlCreateInput("", 128, 144, 121, 21)
$Input5x = GUICtrlCreateInput("", 128, 168, 121, 21)
$Input6x = GUICtrlCreateInput("", 128, 192, 121, 21)
$Input7x = GUICtrlCreateInput("", 128, 216, 121, 21)
$Input8x = GUICtrlCreateInput("", 128, 240, 121, 21)
$Input9x = GUICtrlCreateInput("", 128, 264, 121, 21)
$Input10x = GUICtrlCreateInput("", 128, 288, 121, 21)
$Input11x = GUICtrlCreateInput("", 128, 312, 121, 21)
$Input12x = GUICtrlCreateInput("", 128, 336, 121, 21)
$Input13x = GUICtrlCreateInput("", 128, 360, 121, 21)
$Input14x = GUICtrlCreateInput("", 128, 384, 121, 21)
$Input15x = GUICtrlCreateInput("", 128, 408, 121, 21)
$Input16x = GUICtrlCreateInput("", 128, 432, 121, 21)
$Input17x = GUICtrlCreateInput("", 128, 456, 121, 21)
$Input18x = GUICtrlCreateInput("", 128, 480, 121, 21)
$Input1y = GUICtrlCreateInput("", 256, 72, 121, 21)
$Input2y = GUICtrlCreateInput("", 256, 96, 121, 21)
$Input3y = GUICtrlCreateInput("", 256, 120, 121, 21)
$Input4y = GUICtrlCreateInput("", 256, 144, 121, 21)
$Input5y = GUICtrlCreateInput("", 256, 168, 121, 21)
$Input6y = GUICtrlCreateInput("", 256, 192, 121, 21)
$Input7y = GUICtrlCreateInput("", 256, 216, 121, 21)
$Input8y = GUICtrlCreateInput("", 256, 240, 121, 21)
$Input9y = GUICtrlCreateInput("", 256, 264, 121, 21)
$Input10y = GUICtrlCreateInput("", 256, 288, 121, 21)
$Input11y = GUICtrlCreateInput("", 256, 312, 121, 21)
$Input12y = GUICtrlCreateInput("", 256, 336, 121, 21)
$Input13y = GUICtrlCreateInput("", 256, 360, 121, 21)
$Input14y = GUICtrlCreateInput("", 256, 384, 121, 21)
$Input15y = GUICtrlCreateInput("", 256, 408, 121, 21)
$Input16y = GUICtrlCreateInput("", 256, 432, 121, 21)
$Input17y = GUICtrlCreateInput("", 256, 456, 121, 21)
$Input18y = GUICtrlCreateInput("", 256, 480, 121, 21)
$Input1z = GUICtrlCreateInput("", 384, 72, 121, 21)
$Input2z = GUICtrlCreateInput("", 384, 96, 121, 21)
$Input3z = GUICtrlCreateInput("", 384, 120, 121, 21)
$Input4z = GUICtrlCreateInput("", 384, 144, 121, 21)
$Input5z = GUICtrlCreateInput("", 384, 168, 121, 21)
$Input6z = GUICtrlCreateInput("", 384, 192, 121, 21)
$Input7z = GUICtrlCreateInput("", 384, 216, 121, 21)
$Input8z = GUICtrlCreateInput("", 384, 240, 121, 21)
$Input9z = GUICtrlCreateInput("", 384, 264, 121, 21)
$Input10z = GUICtrlCreateInput("", 384, 288, 121, 21)
$Input11z = GUICtrlCreateInput("", 384, 312, 121, 21)
$Input12z = GUICtrlCreateInput("", 384, 336, 121, 21)
$Input13z = GUICtrlCreateInput("", 384, 360, 121, 21)
$Input14z = GUICtrlCreateInput("", 384, 384, 121, 21)
$Input15z = GUICtrlCreateInput("", 384, 408, 121, 21)
$Input16z = GUICtrlCreateInput("", 384, 432, 121, 21)
$Input17z = GUICtrlCreateInput("", 384, 456, 121, 21)
$Input18z = GUICtrlCreateInput("", 384, 480, 121, 21)
$Label1 = GUICtrlCreateLabel("Computer Name", 8, 72, 80, 17)
$Label2 = GUICtrlCreateLabel("CPU Architecture", 8, 96, 86, 17)
$Label3 = GUICtrlCreateLabel("IP Adress", 8, 120, 49, 17)
$Label4 = GUICtrlCreateLabel("Logon DNS Domain", 8, 144, 99, 17)
$Label5 = GUICtrlCreateLabel("Logon Domain", 8, 168, 73, 17)
$Label6 = GUICtrlCreateLabel("Logon Server", 8, 192, 68, 17)
$Label7 = GUICtrlCreateLabel("OS Architecture", 8, 216, 79, 17)
$Label8 = GUICtrlCreateLabel("OS Build", 8, 240, 45, 17)
$Label9 = GUICtrlCreateLabel("OS Language", 8, 264, 70, 17)
$Label10 = GUICtrlCreateLabel("OS Service Pack", 8, 288, 86, 17)
$Label11 = GUICtrlCreateLabel("OS Type", 8, 312, 46, 17)
$Label12 = GUICtrlCreateLabel("OS Version", 8, 336, 57, 17)
$Label13 = GUICtrlCreateLabel("Harddrive File System", 8, 360, 106, 17)
$Label14 = GUICtrlCreateLabel("Harddrive Space Free", 8, 384, 108, 17)
$Label15 = GUICtrlCreateLabel("Harddrive Space Total", 8, 408, 111, 17)
$Label16 = GUICtrlCreateLabel("Total Physical RAM", 8, 432, 97, 17)
$Label17 = GUICtrlCreateLabel("Available Physical RAM", 8, 456, 116, 17)
$Label18 = GUICtrlCreateLabel("MAC Adress", 8, 480, 62, 17)
$Label19 = GUICtrlCreateLabel("Computer 1", 152, 40, 58, 17)
$Label20 = GUICtrlCreateLabel("Computer 2", 280, 40, 58, 17)
$Label21 = GUICtrlCreateLabel("Computer 3", 416, 40, 58, 17)
$Button1 = GUICtrlCreateButton("The Textfile", 24, 16, 75, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
DirCreate("C:\Inventory\Log")
Global $sFile, $hFile, $sText, $i
Global $ii[3]
$ii[0] = "x"
$ii[1] = "y"
$ii[2] = "z"
$aDato = _Date_Time_GetSystemTime()
$Dato = _Date_Time_SystemTimeToArray($aDato)
TCPStartup()
$KlientSocket = TCPListen(@IPAddress1, 1337)

$KlientRecv = ""
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Button1
   _RunDOS("start c:\Inventory\log\")
EndSwitch
Do
$TCPAccept = TCPAccept($KlientSocket)
Until $TCPAccept <> -1
For $ii = 0 To 2 Step 1
For $i = 1 To 18 Step 1
  Do
   $KlientRecv[$i] = TCPRecv($TCPAccept, 2048)
  Until $KlientRecv[$i] <> ""
  If $i = 8 Or 14 Or 15 Or 16 Or 17 Then
   $KlientRecv[$i] = _StringEncrypt(0, $KlientRecv[$i], "hei")
  EndIf
  GUICtrlSetData($Input[$i][$ii], $KlientRecv[$i])
  _WriteToLog(GuiCtrlRead($Label[$i]), $KlientRecv[$i])
Next
Next
TCPCloseSocket($KlientSocket)
WEnd
Func _WriteToLog($labelname, $Recv)
    $sFile = 'C:\Inventory\Log\' & $Dato[2] & $Dato[0] & $Dato[1] & '.log'
    $sText = '' & $labelname & ' | ' & $Recv & ' ' & @CRLF & ''
    $hFile = FileOpen($sFile, 1) ;Burde være i starten av et script for performance-improvement
    FileWrite($hFile, $sText)
    FileClose($hFile) ;Burde være i slutten av et script for performance-improvement
    ConsoleWrite('1) ' & FileRead($sFile) & @CRLF)
EndFunc

Challenge accepted!

Share this post


Link to post
Share on other sites



This is because you're not declaring $Input as a 2D array, but as a single value type e.g. integer, string etc. Have a look at the Wiki entry that discusses about Arrays.

Example:

Local $aInput[6][2] = [[5]]

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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: 04/09/2015

Share this post


Link to post
Share on other sites

Tried changing all $Input and $Label to array and now it compiles, but the client sending signals bugs everything and gets an error message.

Line 4375 (File "......."):

Error: Subscript used with non-Array variable.

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=c:tempInventory_Server.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseX64=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Process.au3>
#include <WinAPI.au3>
#include <Date.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Inventory Viewer", 523, 523, 238, 143)
Local $Input[18][3]
Local $Label[18]
$Input[0][0] = GUICtrlCreateInput("", 128, 72, 121, 21)
$Input[1][0] = GUICtrlCreateInput("", 128, 96, 121, 21)
$Input[2][0] = GUICtrlCreateInput("", 128, 120, 121, 21)
$Input[3][0] = GUICtrlCreateInput("", 128, 144, 121, 21)
$Input[4][0] = GUICtrlCreateInput("", 128, 168, 121, 21)
$Input[5][0] = GUICtrlCreateInput("", 128, 192, 121, 21)
$Input[6][0] = GUICtrlCreateInput("", 128, 216, 121, 21)
$Input[7][0] = GUICtrlCreateInput("", 128, 240, 121, 21)
$Input[8][0] = GUICtrlCreateInput("", 128, 264, 121, 21)
$Input[9][0] = GUICtrlCreateInput("", 128, 288, 121, 21)
$Input[10][0] = GUICtrlCreateInput("", 128, 312, 121, 21)
$Input[11][0] = GUICtrlCreateInput("", 128, 336, 121, 21)
$Input[12][0] = GUICtrlCreateInput("", 128, 360, 121, 21)
$Input[13][0] = GUICtrlCreateInput("", 128, 384, 121, 21)
$Input[14][0] = GUICtrlCreateInput("", 128, 408, 121, 21)
$Input[15][0] = GUICtrlCreateInput("", 128, 432, 121, 21)
$Input[16][0] = GUICtrlCreateInput("", 128, 456, 121, 21)
$Input[17][0] = GUICtrlCreateInput("", 128, 480, 121, 21)
$Input[0][1] = GUICtrlCreateInput("", 256, 72, 121, 21)
$Input[1][1] = GUICtrlCreateInput("", 256, 96, 121, 21)
$Input[2][1] = GUICtrlCreateInput("", 256, 120, 121, 21)
$Input[3][1] = GUICtrlCreateInput("", 256, 144, 121, 21)
$Input[4][1] = GUICtrlCreateInput("", 256, 168, 121, 21)
$Input[5][1] = GUICtrlCreateInput("", 256, 192, 121, 21)
$Input[6][1] = GUICtrlCreateInput("", 256, 216, 121, 21)
$Input[7][1] = GUICtrlCreateInput("", 256, 240, 121, 21)
$Input[8][1] = GUICtrlCreateInput("", 256, 264, 121, 21)
$Input[9][1] = GUICtrlCreateInput("", 256, 288, 121, 21)
$Input[10][1] = GUICtrlCreateInput("", 256, 312, 121, 21)
$Input[11][1] = GUICtrlCreateInput("", 256, 336, 121, 21)
$Input[12][1] = GUICtrlCreateInput("", 256, 360, 121, 21)
$Input[13][1] = GUICtrlCreateInput("", 256, 384, 121, 21)
$Input[14][1] = GUICtrlCreateInput("", 256, 408, 121, 21)
$Input[15][1] = GUICtrlCreateInput("", 256, 432, 121, 21)
$Input[16][1] = GUICtrlCreateInput("", 256, 456, 121, 21)
$Input[17][1] = GUICtrlCreateInput("", 256, 480, 121, 21)
$Input[0][2] = GUICtrlCreateInput("", 384, 72, 121, 21)
$Input[1][2] = GUICtrlCreateInput("", 384, 96, 121, 21)
$Input[2][2] = GUICtrlCreateInput("", 384, 120, 121, 21)
$Input[3][2] = GUICtrlCreateInput("", 384, 144, 121, 21)
$Input[4][2] = GUICtrlCreateInput("", 384, 168, 121, 21)
$Input[5][2] = GUICtrlCreateInput("", 384, 192, 121, 21)
$Input[6][2] = GUICtrlCreateInput("", 384, 216, 121, 21)
$Input[7][2] = GUICtrlCreateInput("", 384, 240, 121, 21)
$Input[8][2] = GUICtrlCreateInput("", 384, 264, 121, 21)
$Input[9][2] = GUICtrlCreateInput("", 384, 288, 121, 21)
$Input[10][2] = GUICtrlCreateInput("", 384, 312, 121, 21)
$Input[11][2] = GUICtrlCreateInput("", 384, 336, 121, 21)
$Input[12][2] = GUICtrlCreateInput("", 384, 360, 121, 21)
$Input[13][2] = GUICtrlCreateInput("", 384, 384, 121, 21)
$Input[14][2] = GUICtrlCreateInput("", 384, 408, 121, 21)
$Input[15][2] = GUICtrlCreateInput("", 384, 432, 121, 21)
$Input[16][2] = GUICtrlCreateInput("", 384, 456, 121, 21)
$Input[17][2] = GUICtrlCreateInput("", 384, 480, 121, 21)
$Label[0] = GUICtrlCreateLabel("Computer Name", 8, 72, 80, 17)
$Label[1] = GUICtrlCreateLabel("CPU Architecture", 8, 96, 86, 17)
$Label[2] = GUICtrlCreateLabel("IP Adress", 8, 120, 49, 17)
$Label[3] = GUICtrlCreateLabel("Logon DNS Domain", 8, 144, 99, 17)
$Label[4] = GUICtrlCreateLabel("Logon Domain", 8, 168, 73, 17)
$Label[5] = GUICtrlCreateLabel("Logon Server", 8, 192, 68, 17)
$Label[6] = GUICtrlCreateLabel("OS Architecture", 8, 216, 79, 17)
$Label[7] = GUICtrlCreateLabel("OS Build", 8, 240, 45, 17)
$Label[8] = GUICtrlCreateLabel("OS Language", 8, 264, 70, 17)
$Label[9] = GUICtrlCreateLabel("OS Service Pack", 8, 288, 86, 17)
$Label[10] = GUICtrlCreateLabel("OS Type", 8, 312, 46, 17)
$Label[11] = GUICtrlCreateLabel("OS Version", 8, 336, 57, 17)
$Label[12] = GUICtrlCreateLabel("Harddrive File System", 8, 360, 106, 17)
$Label[13] = GUICtrlCreateLabel("Harddrive Space Free", 8, 384, 108, 17)
$Label[14] = GUICtrlCreateLabel("Harddrive Space Total", 8, 408, 111, 17)
$Label[15] = GUICtrlCreateLabel("Total Physical RAM", 8, 432, 97, 17)
$Label[16] = GUICtrlCreateLabel("Available Physical RAM", 8, 456, 116, 17)
$Label[17] = GUICtrlCreateLabel("MAC Adress", 8, 480, 62, 17)
$Label19 = GUICtrlCreateLabel("Computer 1", 152, 40, 58, 17)
$Label20 = GUICtrlCreateLabel("Computer 2", 280, 40, 58, 17)
$Label21 = GUICtrlCreateLabel("Computer 3", 416, 40, 58, 17)
$Button1 = GUICtrlCreateButton("The Textfile", 24, 16, 75, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
DirCreate("C:InventoryLog")
Global $sFile, $hFile, $sText, $i
Global $ii[3]
$ii[0] = "x"
$ii[1] = "y"
$ii[2] = "z"
$aDato = _Date_Time_GetSystemTime()
$Dato = _Date_Time_SystemTimeToArray($aDato)
TCPStartup()
$KlientSocket = TCPListen(@IPAddress1, 1337)
$KlientRecv = ""
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Button1
   _RunDOS("start c:Inventorylog")
EndSwitch
Do
$TCPAccept = TCPAccept($KlientSocket)
Until $TCPAccept <> -1
For $ii = 0 To 2 Step 1
For $i = 1 To 18 Step 1
  Do
   $KlientRecv[$i] = TCPRecv($TCPAccept, 2048)
  Until $KlientRecv[$i] <> ""
  If $i = 8 Or 14 Or 15 Or 16 Or 17 Then
   $KlientRecv[$i] = _StringEncrypt(0, $KlientRecv[$i], "hei")
  EndIf
  GUICtrlSetData($Input[$i][$ii], $KlientRecv[$i])
  _WriteToLog(GuiCtrlRead($Label[$i]), $KlientRecv[$i])
Next
Next
TCPCloseSocket($KlientSocket)

WEnd
Func _WriteToLog($labelname, $Recv)
    $sFile = 'C:InventoryLog' & $Dato[2] & $Dato[0] & $Dato[1] & '.log'
    $sText = '' & $labelname & ' | ' & $Recv & ' ' & @CRLF & ''
    $hFile = FileOpen($sFile, 1) ;Burde være i starten av et script for performance-improvement
    FileWrite($hFile, $sText)
    FileClose($hFile) ;Burde være i slutten av et script for performance-improvement
    ConsoleWrite('1) ' & FileRead($sFile) & @CRLF)
EndFunc

Challenge accepted!

Share this post


Link to post
Share on other sites

Try running you script from SciTE to pinpoint the line number as from the snippet of code there isn't 4000+ lines, which occurs when all the includes are consolidated into 1 file at compiling.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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: 04/09/2015

Share this post


Link to post
Share on other sites

M:pcDokumenterAutoITProsjekterInventory_server.au3 (131) : ==> Subscript used with non-Array variable.:

$KlientRecv[$i] = TCPRecv($TCPAccept, 2048)

$KlientRecv^ ERROR

->13:50:51 AutoIT3.exe ended.rc:1

The first $KlientRecv[$i] after FOR


Challenge accepted!

Share this post


Link to post
Share on other sites

Added these:

Local $KlientRecv[18]
$KlientRecv[0] = ""
$KlientRecv[1] = ""
$KlientRecv[2] = ""
$KlientRecv[3] = ""
$KlientRecv[4] = ""
$KlientRecv[5] = ""
$KlientRecv[6] = ""
$KlientRecv[7] = ""
$KlientRecv[8] = ""
$KlientRecv[9] = ""
$KlientRecv[10] = ""
$KlientRecv[11] = ""
$KlientRecv[12] = ""
$KlientRecv[13] = ""
$KlientRecv[14] = ""
$KlientRecv[15] = ""
$KlientRecv[16] = ""
$KlientRecv[17] = ""

And it actually worked, but now it shows weird results..

I'll check it further and get back here if I need more assistance :D

Thanks


Challenge accepted!

Share this post


Link to post
Share on other sites

Hi Akarillon,

I just had a look at your script. You were talking about up to 400 computers you would like to get inventory data for.

For usability reasons I would change the layout of your GUI "a bit". I have written a similar script for our Active Directory environment (for users and groups).

On the main screen the data is displayed in a ListView (in your case this might be computer name, location, assigned user ...) - as much as can be displayed without horizontal scrolling. The GUI has some selection buttons which open an input field to select the data by computer name (our computers start with NB if its a notebook, or TC if its a thin client ...), location etc. Then display the selected items plus display the used filter on top of the list. A right click might open a context menu which lets you display the details of the computer, print the details, compare two computers if the user selected multiple computers in the ListView etc.

A ListView offers a lot of posibilities. If you need some code, just drop me a note.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  
Followers 0