Chimaera Posted September 16, 2011 Share Posted September 16, 2011 Having a little prob with displaying an array of items for a user Ive obtained all 6 arrays then added together then used $aArrayShow = _ArrayUnique( $aHKLM_Run_Deleted) This works $sFile = @ScriptDir & "\RegBackup\deleted_log.txt" _FileWriteFromArray( $sFile , $aArrayShow) ShellExecuteWait( $sFile) Just dosent look nice opening a notepad This works _ArrayDisplay($aArrayShow, "Deleted Items") Again doesnt look nice having the array box with the copy selected bit at the bottom and the excel type boxes etc But this which is the one i would like to use doesnt work SplashTextOn( "Removed Items", $aArrayShow & @CRLF) Sleep(4000) SplashOff() it displays the splash fine but no text on it Is there a simple way to get the splash to show the array items so i can make a better looking display? The array is fine and working properly its the display of it that is an issue Any suggestions? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
guinness Posted September 16, 2011 Share Posted September 16, 2011 SplashTextOn doesn't support arrays being passed to it. Look at the GUI functions to create a 'custom' _ArrayDisplay() by using GUICtrlCreateListView & GUICtrlCreateListViewItem & to get an idea of how I did it or would do it look at the example 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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
JohnOne Posted September 16, 2011 Share Posted September 16, 2011 Loop through the array adding the elements Local $SplashText = '' For $i = 0 To UBound($aArrayShow) -1 $SplashText &= $aArrayShow[$i & @CRLF) Next SplashTextOn( "Removed Items", $SplashText) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Chimaera Posted September 16, 2011 Author Share Posted September 16, 2011 getting this error Error in expression.: $SplashText &= $aArrayShow($i & @CRLF) $SplashText &= ^ ERROR If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
JohnOne Posted September 16, 2011 Share Posted September 16, 2011 $SplashText &= $aArrayShow[$i] & @CRLF AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Chimaera Posted September 16, 2011 Author Share Posted September 16, 2011 aah thats why thx guys i corrected the square one i should have changed the other lol If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
AdamUL Posted September 16, 2011 Share Posted September 16, 2011 I prefer to use _ArrayToString for something like this. Using your preferred method. #include <Array.au3> Global $aArrayShow[7] = [6, "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6"] SplashTextOn( "Removed Items", _ArrayToString($aArrayShow, @CRLF, 1) & @CRLF) Sleep(4000) SplashOff() Adam Link to comment Share on other sites More sharing options...
Chimaera Posted September 17, 2011 Author Share Posted September 17, 2011 Thx adam ill have a look later One extra question When the array is made for every concatenate it has a number at the top so i end up with numbers here and there in the list. Is there a way to exclude all numbers from the final list, the items the list will display has no numbers at all $aArrayShow = _ArrayUnique($aHKLM_Run_Deleted) $sFile = @HomeDrive & "\RegBackup\deleted_log.txt" _FileWriteFromArray($sFile, $aArrayShow) Local $SplashText = '' For $i = 2 To UBound($aArrayShow) - 1 $SplashText &= $aArrayShow[$i] & @CRLF Next SplashTextOn("Removed Items", $SplashText, 250, 350, -1, -1, 6) Sleep(4000) SplashOff() If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2011 Share Posted September 17, 2011 When the array is made for every concatenate it has a number at the top so i end up with numbers here and there in the list. I don't understand this, can you give a representation of what the splashtext looks like? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Chimaera Posted September 17, 2011 Author Share Posted September 17, 2011 Ok ill try but i haven't got a test one From memory2 ;<<<these 2 are from the main creation1Acer Assist LauncherACMON4 ; << this one is added from one of the concatenates, its the header from another arrayISUSPM What i want to see isAcer Assist LauncherACMONISUSPM does that make any sense? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2011 Share Posted September 17, 2011 Perhaps something like this. Local $SplashText = '' For $i = 2 To UBound($aArrayShow) - 1 If Not StringIsAlNum($aArrayShow[$i]) Then; if the element is not just alpha numeric chars, then add it. $SplashText &= $aArrayShow[$i] & @CRLF EndIf Next SplashTextOn("Removed Items", $SplashText, 250, 350, -1, -1, 6) Sleep(4000) SplashOff() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Chimaera Posted September 17, 2011 Author Share Posted September 17, 2011 (edited) ok thanks i made a fake reg key to get a log 4 1 2 uTorrent But the splash showed nothing i think the space maybe interfering another test one 7 1 3 MSMSGS nwiz 4 uTorrent again splash was empty Tried this with partial success If Not StringIsAlNum($aArrayShow[$i]) Or Not StringIsSpace($aArrayShow[$i]) Then; if the element is not just alpha numeric chars, then add it. $SplashText &= $aArrayShow[$i] & @CRLF EndIf 7 ;<< it removed this 1;<< it removed this ;<< it removed this 3 ;<< but not this MSMSGS Edited September 17, 2011 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
czardas Posted September 17, 2011 Share Posted September 17, 2011 I thought there might be a flag for this, but it seems not. The simplest way would be to delete the first element. #include <Array.au3> Local $aArray[8] = ["Bob","Bob","Alice","John","Jane","Alice","John","Mary"] $aArray = _ArrayUnique($aArray) _ArrayDisplay($aArray, "Before") _ArrayDelete($aArray, 0) _ArrayDisplay($aArray, "After") operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Chimaera Posted September 17, 2011 Author Share Posted September 17, 2011 Ok i went back to the source for each array and removed the first element and the same for the unique and i still get a space but all numbers seem to have gone If Not StringIsSpace($aArrayShow[$i]) Then $SplashText &= $aArrayShow[$i] & @CRLF EndIf Im attempting to use this to remove the space but from testing i get the feeling it will still turn up thx again If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
czardas Posted September 17, 2011 Share Posted September 17, 2011 (edited) I'm not sure where the spaces are coming from. I made a change to John's code above. Does this remove the spaces? Local $SplashText = '' For $i = 0 To UBound($aArrayShow) -2 ; <== Changed this $SplashText &= $aArrayShow[$i] & @CRLF Next $SplashText &= $aArrayShow[$i] ; <== Do not concatenate @CRLF at the end SplashTextOn( "Removed Items", $SplashText) Hmm, I think I'm wrong there. It was just a quick guess. Perhaps you could post the code you have ATM. Edited September 17, 2011 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Chimaera Posted September 17, 2011 Author Share Posted September 17, 2011 (edited) the space is the 0 part of the array ur code gave me ACMON Adobe ARM in the save file but the splash was ACMON weird without ur addition it shows both items in the splash with a space above them truthfully the extra space above the items isnt that big a deal now i have no numbers, ill play around and see what happens thanks again Edited September 17, 2011 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2011 Share Posted September 17, 2011 (edited) How about this? Local $SplashText = '' For $i = 2 To UBound($aArrayShow) - 1 If Not StringIsAlNum(StringStripWS($aArrayShow[$i],8)) Then; if the element is not just alpha numeric chars after all white space removed, then add it. $SplashText &= $aArrayShow[$i] & @CRLF EndIf Next SplashTextOn("Removed Items", $SplashText, 250, 350, -1, -1, 6) Sleep(4000) SplashOff() Edited September 17, 2011 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
czardas Posted September 17, 2011 Share Posted September 17, 2011 Yeah that's strange. It must be something in your code. When you say 'the space is the 0 part of the array', do you mean it is the first element (element zero). Is it just an empty string? You could try:this: Local $SplashText = '' For $i = 0 To UBound($aArrayShow) -1 If ($aArrayShow[$i] = "") Or StringIsSpace($aArrayShow[$i]) Then ContinueLoop ; Return to the start of the loop $SplashText &= $aArrayShow[$i] & @CRLF Next SplashTextOn( "Removed Items", $SplashText) operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Chimaera Posted September 21, 2011 Author Share Posted September 21, 2011 With a combination of both its sorted now as far as removing the the uneeded chars The only thing im curious about is.. Is there a way to list a total for how many it has found? So that i can display a count it has found "X" items for removal? I had a look at Local $aResult = _ArrayFindAll($SplashText, "") < tried 0 as well ConsoleWrite($aResult) But it just reurns -1 either way Then i noticed _ArrayCombinations gives this Returns an array, the first element ($array[0]) contains the number of strings returned. So is there a way to give me just the number of strings? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
czardas Posted September 21, 2011 Share Posted September 21, 2011 (edited) Count as you go along. From the previous example: Local $SplashText = '' Local $iCount = 0 For $i = 0 To UBound($aArrayShow) -1 If ($aArrayShow[$i] = "") Or StringIsSpace($aArrayShow[$i]) Then ContinueLoop ; Return to the start of the loop $SplashText &= $aArrayShow[$i] & @CRLF $iCount += 1 Next SplashTextOn( "Removed Items", $SplashText) Subtract $iCount from the total to get the number of items removed. Edited September 21, 2011 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now