ancp Posted July 12, 2010 Posted July 12, 2010 I apologize for propably asking a old question once more - I could not find... Is possible to fast initialize array, like: Dim $aItems[600] = 0xC1 instead of Dim $aItems[600] for $i = 0 to ubound($aItems) - 1 $aItems[$i] = 0xC1 next And one subquestion. Are math and bitwise operations with hexadecimal values faster than decimal values? $var = BitOR($aItem[$i], BitAND($var, 0x1F), 1)) vs $var = BitOR($aItem[$i], BitAND($var, 31), 1)) Thanks in advance
Moderators Melba23 Posted July 12, 2010 Moderators Posted July 12, 2010 ancp,1. No. You either use a loop or you have to do this:Dim $aItems[600] = [0xC1, 0xC1, 0xC1, ...another 596 elements..., 0xC1]which is MUCH longer! By the way, try not to use Dim. It is better practice to specifically scope your variables with Global/Local instead. 2. Given the relative slowness of AutoIt, I cannot believe it makes any difference which you use unless you have a seriously large number of such lines in your script - but I am quite prepared to be proved wrong! 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
ancp Posted July 12, 2010 Author Posted July 12, 2010 Thanks Melba, I understand. 2. Given the relative slowness of AutoIt, I cannot believe it makes any difference which you use unless you have a seriously large number of such lines in your script - but I am quite prepared to be proved wrong! Not much of a big numbers, but many of bitwise operations. I understand that AutoIt is not very fast but it's very comfortable thank you for the reply.
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