Fly By Night Posted August 26, 2011 Share Posted August 26, 2011 (edited) In all my years dabbling with AutoItScript, i've never figured this out. How do you define a null array? Is $clipQ[1] = [""] considered a null array? I've tried $clipQ = "" but when you try to do array operations on it, they seem to fail. With the _ArrayPop function, If the array has one element left, it will be set to "" after _ArrayPop() is used on it. What is that setting the array too as you can't display the array using _ArrayDisplay anymore. Is is going back to setting the array as an empty string as when i try to do an _ArrayAdd after it's popped the last item, this doesn't work? How do you get around that? Thanks for any info to clear this for me. Edited August 26, 2011 by Fly By Night Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 26, 2011 Moderators Share Posted August 26, 2011 Fly By Night,You cannot have a NULL array in AutoIt - you must have at least 1 element. So when you _ArrayPop the final element, you no longer have an array - just a normal (but empty) variable. If you want to know more, I suggest reading this thread. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Fly By Night Posted August 26, 2011 Author Share Posted August 26, 2011 (edited) Fly By Night, You cannot have a NULL array in AutoIt - you must have at least 1 element. So when you _ArrayPop the final element, you no longer have an array - just a normal (but empty) variable. If you want to know more, I suggest reading this thread. M23 Cheers. Now i know why i've never managed to figured out how to have an empty array...lol. Just never asked about it and made workarounds. Just trying to make a queue and sometimes it will be empty. Will just have to have a dummy entry in to keep array alive i guess. Thanks again. Edited August 26, 2011 by Fly By Night Link to comment Share on other sites More sharing options...
ProgAndy Posted August 26, 2011 Share Posted August 26, 2011 Just trying to make a queue and sometimes it will be empty. Will just have to have a dummy entry in to keep array alive i guess.Why? Just use IsArray($x) instead of something like IsArrayEmpty($x) and you can implement your empty array without problems PS: To create a queue, I prefer a circular buffer if you can accept a limited quoue length. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Fly By Night Posted August 26, 2011 Author Share Posted August 26, 2011 Cheers i just read the info at the thread pointed to by Melba23 so will go work on these techniques. 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