Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/22/2015 in all areas

  1. Virtual listviews are lightning fast and can handle millions of rows. Virtual listviews are of interest when you have to insert more than 10,000 rows. When there are less than 10,000 rows, the standard listviews are sufficiently rapid. See the section "Using standard listviews" below. In a virtual listview data are not stored directly in the listview. Data are stored in an array, a structure (DllStructCreate), a flat fixed-length record file, a database or similar. The listview only contains the rows which are visible depending on the height of the listview. See About List-View Controls in the MicroSoft documentation for more information. An array or a structure can be used for listviews with 10,000 - 100,000 rows. If there are more than 100,000 rows a fixed-length record file or a database seems to be the best solution, because they have low impact on memory usage. But you get nothing for free. The costs is that a part of the built-in features does not work, and you will have to implement these features yourself. Because data isn't stored in the listview the Set- and Get-functions to manipulate data doesn't work. You have to manipulate the data source directly. And sorting is not supported at all by virtual listviews. If you need sorting, a database seems to be the best solution in all cases, because sorting can be handled by the database. Below you'll find the following sections: Data stored in arrays Data stored in databases Data stored in fixed-length record files Sorting rows in a virtual listview $LVN_ODFINDITEM notifications Using standard listviews Updates Zip file Examples The next two sections shows how to use virtual listviews, when data are stored in arrays or databases. In first section data are stored in 3 arrays with 10,000/50,000/100,000 rows and 10 columns. In second section data are stored in 3 databases with 100,000/1,000,000/10,000,000 rows and 10 columns. Data stored in arrays For a virtual listview rows are displayed with $LVN_GETDISPINFO notifications and the $tagNMLVDISPINFO structure. Code for $LVN_GETDISPINFO messages in the WM_NOTIFY function can be implemented in this manner: Case $LVN_GETDISPINFOW Local $tNMLVDISPINFO = DllStructCreate( $tagNMLVDISPINFO, $lParam ) If BitAND( DllStructGetData( $tNMLVDISPINFO, "Mask" ), $LVIF_TEXT ) Then Local $sItem = $aItems[DllStructGetData($tNMLVDISPINFO,"Item")][DllStructGetData($tNMLVDISPINFO,"SubItem")] DllStructSetData( $tText, 1, $sItem ) DllStructSetData( $tNMLVDISPINFO, "Text", $pText ) DllStructSetData( $tNMLVDISPINFO, "TextMax", StringLen( $sItem ) ) EndIf Run LvVirtArray.au3. It takes some time to create the arrays. But when the arrays are created, switching from one array to another (which means updating the listview) is instantaneous. Data stored in databases When data are stored in a database, $LVN_ODCACHEHINT notifications and the $tagNMLVCACHEHINT structure is used to insert the rows in an array cache before they are displayed with $LVN_GETDISPINFO messages. The $tagNMLVCACHEHINT structure is defined in this way: Global Const $tagNMLVCACHEHINT = $tagNMHDR & ";int iFrom;int iTo" Note that $tagNMLVCACHEHINT is not included in GuiListView.au3 or StructureConstants.au3. Code for $LVN_ODCACHEHINT messages in the WM_NOTIFY function can be implemented in this manner: Case $LVN_ODCACHEHINT Local $tNMLVCACHEHINT = DllStructCreate( $tagNMLVCACHEHINT, $lParam ), $iColumns $iFrom = DllStructGetData( $tNMLVCACHEHINT, "iFrom" ) Local $sSQL = "SELECT * FROM lvdata WHERE item_id >= " & $iFrom & _ " AND item_id <= " & DllStructGetData( $tNMLVCACHEHINT, "iTo" ) & ";" _SQLite_GetTable2d( -1, $sSQL, $aResult, $iRows, $iColumns ) $aResult is the array cache. The purpose of the cache is to limit the number of SELECT statements. When the listview is displayed for the first time, all visible rows (in this example about 20) have to be updated. In this case $aResult will contain 20 rows and 10 columns. 20 rows is also the maximum number of rows in $aResult. A virtual listview will never update more than the visible number of rows at one time. Code for $LVN_GETDISPINFO messages can be implemented in this way: Case $LVN_GETDISPINFOW Local $tNMLVDISPINFO = DllStructCreate( $tagNMLVDISPINFO, $lParam ) If BitAND( DllStructGetData( $tNMLVDISPINFO, "Mask" ), $LVIF_TEXT ) Then Local $iIndex = DllStructGetData( $tNMLVDISPINFO, "Item" ) - $iFrom + 1 If $iIndex > 0 And $iIndex < $iRows + 1 Then Local $sItem = $aResult[$iIndex][DllStructGetData($tNMLVDISPINFO,"SubItem")] DllStructSetData( $tText, 1, $sItem ) DllStructSetData( $tNMLVDISPINFO, "Text", $pText ) DllStructSetData( $tNMLVDISPINFO, "TextMax", StringLen( $sItem ) ) EndIf EndIf The zip below contains a small GUI, CreateDB.au3, to create 3 SQLite databases with 100,000/1,000,000/10,000,000 rows. The databases will use about 10/100/1000 MB of diskspace, and the creation will take about ½/5/40 minutes (on an old XP). You must select a database and click a button to start the creation. If you get tired of waiting, you can cancel (checked for every 10,000 rows) the process and continue another time. The process will continue where it stopped. You can run the examples even though the databases might only contain 30,000/200,000/1,500,000 rows. You do not have to create all three databases. Run LvVirtDB.au3. Data stored in fixed-length record files (update 2015-04-01) Extracting data directly from a fixed-length record file by setting the file pointer to the current record and reading the required number of bytes is another example, where $LVN_ODCACHEHINT messages should be used to insert records in an array cache before they are displayed. Code for $LVN_ODCACHEHINT and $LVN_GETDISPINFO messages can be implemented as shown: Case $LVN_ODCACHEHINT Local $tNMLVCACHEHINT = DllStructCreate( $tagNMLVCACHEHINT, $lParam ) $iFrom = DllStructGetData( $tNMLVCACHEHINT, "iFrom" ) $iRows = DllStructGetData( $tNMLVCACHEHINT, "iTo" ) - $iFrom + 1 FileSetPos( $hFile, $iFrom * 12, 0 ) ; Each line is 10 chars + CR + LF $aCache = StringSplit( FileRead( $hFile, $iRows * 12 - 2 ), @CRLF, 3 ) The purpose of the cache is to limit the number of FileRead statements. Case $LVN_GETDISPINFOW Local $tNMLVDISPINFO = DllStructCreate( $tagNMLVDISPINFO, $lParam ) If BitAND( DllStructGetData( $tNMLVDISPINFO, "Mask" ), $LVIF_TEXT ) Then Local $iIndex = DllStructGetData( $tNMLVDISPINFO, "Item" ) - $iFrom If -1 < $iIndex And $iIndex < $iRows Then DllStructSetData( $tText, 1, $aCache[$iIndex] ) DllStructSetData( $tNMLVDISPINFO, "Text", $pText ) DllStructSetData( $tNMLVDISPINFO, "TextMax", 10 ) ; Each line is 10 chars EndIf EndIf Run LvVirtFile.au3. A fixed-length record file with 10,000 records (LvVirtFile.txt) is included in the zip. I have tested this example on a 1,1 GB file and 100,000,000 rows. The listview responds immediately. The solution with a flat fixed-length record file is extremely fast. Much faster than a database. But also with very much limited functionality compared to a database. Sorting rows in a virtual listview (update 2015-04-01) Sorting is not supported at all by virtual listviews. If you want rows to be sorted, you have to feed the listview with the rows in sorted order. If the rows are stored in an array, you have to sort the array before you feed the listview. If you want to sort the rows by two or more columns, you have to store the rows in two or more arrays which are sorted for the current column. Or you have to create two or more indexes to handle the sorting. Sorting arrays and creating indexes is time consuming. If you need sorting, a database seems to be the best solution, because sorting can be handled by the database. Nevertheless, here's an example that stores 10,000/20,000/30,000 rows and 3 columns in arrays, and creates indexes to handle the sorting. The columns are strings, integers and floating point numbers, and indexes are calculated for all 3 columns. To be able to create the indexes as fast as possible, structures (DllStructCreate) are used to create the indexes. This is the function to create indexes for integers and floating point numbers. The function for strings is equivalent. $tIndex = DllStructCreate( "uint[" & $iRows & "]" ) Func SortNumbers( ByRef $aItems, $iRows, $iCol, $pIndex, $tIndex ) Local $k, $n, $lo, $hi, $mi, $gt HourglassCursor( True ) WinSetTitle( $hGui, "", "Virtual ListViews. Sort numbers: 0 rows" ) For $i = 0 To $iRows / 10000 - 1 $k = $i * 10000 For $j = 0 To 9999 $n = $aItems[$k+$j][$iCol] ; Binary search $lo = 0 $hi = $k + $j - 1 While $lo <= $hi $mi = Int( ( $lo + $hi ) / 2 ) If $n < $aItems[DllStructGetData($tIndex,1,$mi+1)][$iCol] Then $gt = 0 $hi = $mi - 1 Else $gt = 1 $lo = $mi + 1 EndIf WEnd ; Make space for the new value DllCall( $hKernel32Dll, "none", "RtlMoveMemory", "struct*", $pIndex+($mi+1)*4, "struct*", $pIndex+$mi*4, "ulong_ptr", ($k+$j-$mi)*4 ) ; Insert new value DllStructSetData( $tIndex, 1, $k+$j, $mi+1+$gt ) Next WinSetTitle( $hGui, "", "Virtual ListViews. Sort numbers: " & $k + 10000 & " rows" ) Next HourglassCursor( False ) WinSetTitle( $hGui, "", "Virtual ListViews (sorted)" ) EndFunc Run LvVirtArraySort.au3. It takes some time to create the arrays and indexes. But when everything is created, sorting by different columns and switching from one array to another is instantaneous. Because it's easy and fast to save/load a structure to/from a binary file, it may be advantageous to calculate the arrays and indexes in another script before the GUI is opened. $LVN_ODFINDITEM notifications (update 2015-04-01) Three notifications are important for virtual listviews. $LVN_GETDISPINFO (to get information about the rows to display in the listview) and $LVN_ODCACHEHINT (to store rows from a file or database in an array cache before they are displayed with $LVN_GETDISPINFO messages) are already mentioned above. The last is $LVN_ODFINDITEM, which is used to find a row when you press one or a few keys on the keyboard. Information from $LVN_ODFINDITEM is stored in the $tagNMLVFINDITEM structure. The codebox shows the code for $LVN_ODFINDITEM notifications: Case $LVN_ODFINDITEMW Local $tNMLVFINDITEM = DllStructCreate( $tagNMLVFINDITEM, $lParam ) If BitAND( DllStructGetData( $tNMLVFINDITEM, "Flags" ), $LVFI_STRING ) Then Return SearchText( DllStructGetData( $tNMLVFINDITEM, "Start" ), _ ; Start DllStructGetData( DllStructCreate( "wchar[20]", DllStructGetData( $tNMLVFINDITEM, "Text" ) ), 1 ) ) ; Text EndIf Start is the row where you start the search. Text contains the key presses to search for. You have to implement the search function (here SearchText) yourself. If the function finds a row, it should return the index of the row. If not, it should return -1. Run LvVirtArrayFind.au3. Using standard listviews (update 2015-04-01) If not more than 10,000 rows have to be inserted in a listview, a standard listview is sufficiently rapid. Because of speed you should use native (built-in) functions to fill the listview and not functions in GuiListView.au3 UDF. When the listview is filled, you can use all the functions in the UDF. This code shows how to quickly fill a listview with native functions: Func FillListView( $idLV, ByRef $aItems, $iRows ) Local $tLVITEM = DllStructCreate( $tagLVITEM ) Local $pLVITEM = DllStructGetPtr( $tLVITEM ), $k, $s DllStructSetData( $tLVITEM, "Mask", $LVIF_IMAGE ) ; Icon (or image) DllStructSetData( $tLVITEM, "SubItem", 0 ) ; First column HourglassCursor( True ) For $i = 0 To $iRows / 10000 - 1 $k = $i * 10000 For $j = 0 To 9999 ; Text $s = $aItems[$k+$j][0] For $l = 1 To 9 $s &= "|" & $aItems[$k+$j][$l] Next GUICtrlCreateListViewItem( $s, $idLV ) ; Add item and all texts ; Icon Select Case Mod( $k + $j, 3 ) = 0 DllStructSetData( $tLVITEM, "Image", 2 ) ; Icon index Case Mod( $k + $j, 2 ) = 0 DllStructSetData( $tLVITEM, "Image", 1 ) Case Else DllStructSetData( $tLVITEM, "Image", 0 ) EndSelect DllStructSetData( $tLVITEM, "Item", $k + $j ) ; Row GUICtrlSendMsg( $idLV, $LVM_SETITEMW, 0, $pLVITEM ) ; Add icon Next WinSetTitle( $hGui, "", "GUICtrlCreateListViewItem ListViews. Fills listview: " & $k + 10000 & " rows" ) Next HourglassCursor( False ) WinSetTitle( $hGui, "", "GUICtrlCreateListViewItem ListViews" ) EndFunc Run LvStandard.au3. LvStandardIni.au3 shows how to quickly load an inifile (LvStandardIni.ini, created with IniWriteSection) into a listview. Because an inifile is a small file (only the first 32767 chars are read) it should always be loaded into a standard listview. Updates Update 2015-03-24 Added two array-examples. An example (LvVirtArrayIcons.au3) that shows how to use checkboxes and icons, and an example (LvVirtArrayColors.au3) that shows how to draw every second row with a different background color. In this post you can find an example where all items are drawn with a random background color. Update 2015-04-01 Cleaned up code in previous examples. Added more examples as described above. Zip updated. UDF versions (2018-04-27) Over the past weeks, new display functions have been added to Data display functions based on virtual listviews, and new functions have been added to use the listviews as embedded GUI controls. All the functions work and are used in much the same way. Apart from the data source, the function parameters are the same for all functions. The display functions support a wide range of features, all specified via a single function parameter $aFeatures, which is the last parameter. The central code to handle $LVN_ODCACHEHINT and $LVN_GETDISPINFO notifications is very optimized code. First of all, the code is implemented through the subclassing technique. This means that messages are received directly from the operating system and not from AutoIt's internal message management code. Messages are returned again directly to the operating system and again without interference with AutoIt's internal message handling code. Next, the code is divided into different include files each taking care of a particular feature. That way, it's avoided that a lot of control statements makes the code slow. And it's enough to include the code that's actually used. One reason why so much work has been done in optimizing code and developing features is that these functions will also work as UDF versions for the examples here. It's far from a trivial task to develop UDF versions of examples like these. Since the first version of the display functions was created in this thread 2½ years ago and then has been continuously developed, it's obvious to use the functions as UDF versions of these examples. The following examples are implemented as UDF versions: Data stored in arrays Data stored in CSV files Data stored in SQLite databases Zip file Examples in zip: LvVirtArray.au3 - Data stored in arrays LvVirtArrayColors.au3 - Alternating row colors LvVirtArrayFind.au3 - $LVN_ODFINDITEM notifications LvVirtArrayIcons.au3 - Checkboxes and icons LvVirtArraySort.au3 - Sorting rows in a virtual listview LvVirtDB.au3 - Data stored in databases (use CreateDB.au3 to create DBs) LvVirtFile.au3 - Data stored in fixed-length record files LvStandard.au3 - Using standard listviews LvStandardIni.au3 - Load inifile into a listview The size of the zip is caused by a 118 KB txtfile, LvVirtFile.txt, used by LvVirtFile.au3, and a 28 KB inifile, LvStandardIni.ini, used by LvStandardIni.au3. Tested with AutoIt 3.3.10 on Windows 7 64 bit and Windows XP 32 bit. Should work on all AutoIt versions from 3.3.10 and all Windows versions. Virtual ListViews.7z Examples Examples based on virtual listviews. Array examples: A lot of rows and random background colors for each cell - This post in another thread Incremental search (update as you type) in a virtual listview - Post 29 Sorting arrays: Rows can be sorted by strings, integers, floats and checkboxes, checked rows in top - Post 48 File sources: A CSV-file with 100,000 rows and 10 columns is data source - Post 56 SQLite examples: Various issues related to the use of a database - Post 34, 35, 43 An example that shows a way to implement a search box - Post 41
    4 points
  2. Jon

    AutoIt v3.3.13.20 Beta

    AutoIt v3.3.13.20 Beta View File 3.3.13.20 (21st March, 2015) (Beta) AutoIt: Changed: Map uses 64-bit integers.  Fixed #2920: Doc precision about no control position/resizing on initially window for GUiCreate()/WinMove().Fixed #2924: Progress bar style documentation.UDFs: Changed: Removed internal redraw code from _GUIListView_DeleteAllItems() and _GUIListView_DeleteSelectedItems().Changed: _ArrayUnique() can now deal with Int64 values via new parameter,Changed: _SQLite 3.8.6.0 -> 3.8.8.1.Changed: Re-wrote _StringInsert() using native functions.Changed: _HexToString() to _StringToHex() now handles strings and binary as UTF-8 by default.Changed: _FileWriteToLine() overwrite optional parameter is now boolean and not an integer of zero or one. The old values are still supported for now.Changed: _Word_DocOpen() changed from @error = 4 to @error = 0 and @extended = 1 if document could not be opened Read-Write. THIS IS A SCRIPT BREAKING CHANGEChanged: Re-wrote _MathCheckDiv().Added #2877: _GUICtrlRichEdit_GetFont() example improvement.Added #2857: _GUICtrlEdit_GetCueBanner() and _GUICtrlEdit_SetCueBanner().Added #2860: Convert UDF's ptr to struct* type to allow direct passing of a structure.Added #2891: _WinAPI_GetWindowDC() and _WinAPI_RedrawWindow() examples.Added: More _GDIPlus_Font* functions.Added: _WinAPI_GetFontResourceInfo() return more Font information.Added: _WinAPI_GetFontMemoryResourceInfo().Added #2922: _VersionCompare() with different number of fields.Added #2968: Optional parameter $iMSeconds to _SetTime().Added: $SB_ANSI, $SB_UTF16LE, $SB_UTF16BE and $SB_UTF8 constants to StringConstants.au3, for use with BinaryToString() and StringToBinary().Added: Constants to Assign() and IsDeclared().Added #2982: _FTP_Connect() example improvement.Added #2976: #pragma default value.Added #2998: Added missing key (03 - control-break processing) to the _IsPressed() documentation.  Fixed #2868: _WinAPI_SfcIsKeyProtected() ->_WinAPI_SfcIsFileProtected() doc example.Fixed #2874: _GUICtrlRichEdit_SetCharColor() not at insertpoint.Fixed #2875: Broken link in _SendMessage() doc.Fixed #2876: examples running under Windows X64 in 32 bit mode.Fixed #2880: Example for _WinAPI_OpenProcess().Fixed #2881: HotKeySet() doc as "{ASC nnnn}" cannot be usedFixed #2885: Subscript error with _ArrayMax() and _ArrayMin().Fixed #2909: Backslash was not appended in _PathMake() if $sDir was blank.Fixed #2908: _ScreenCapture_Capture() failing due to out of bounds error.Fixed #2911: _ArrayDisplay() GUI controls have wrong coords.Fixed #2917: _WinAPI_AddMRUString() example crash when run in X64 mode (Msdn Bug CreateMRUListW !!!).Fixed #2918: _GDIPlus_GetEncoderParameterList() not working.Fixed: Range setting in _ArrayDisplay().Fixed #2923: Broken link in Related section.Fixed #2934: Typo in _GUICtrlRichEdit_SetZoom() doc.Fixed #2933: Constants reference in _GUICtrlRichEdit_StreamToVar() doc.Fixed: _Array_FindAll() return array incorrectly dimesioned for row search.Fixed #2964: Incorrect structure for $tagWNDCLASS.Fixed: _WinAPI_IsWritable() wrong detection when the device is not ready.Fixed: The seconds parameter in _SetTime() being set as milliseconds.Fixed #2967: Incorrect format of AM/PM when the time was 00:00.Fixed #2993: _WinApi_GetString() doc.AutoItX: Fixed #2882: PixelChecksum bugs.Au3Check: Added: Support of UTF8 with BOM files.AutoIt3Help: Changed: Version number to 1.0.0.7.   Fixed: Crash in SciTE when multiple lines are selected.  Others: Added: IconsMyAutoit3_*.ico to be used when compiling user scripts (small footprint). Submitter Jon Submitted 03/22/2015 Category Beta
    3 points
  3. BetaLeaf, I have amended a few words in the title and text of your OP - please do not change them back. M23
    2 points
  4. UEZ

    _ArrayUnique

    I assume guinness hacked the db to take back his Like vote.
    2 points
  5. jmon

    Calendar UDF (WIP)

    Hello everyone, I started working on this calendar control for my company. It's still a work in progress, and there are some bugs and some features missing, but I still wanted to share it with you guys, to get some comments and ideas for future development. My question would be: "Would you have done it this way?", meaning, would you have built it with labels as I did, or would it be better using GDI+ or other methods? Screenshot: Here is an example (Try double-clicking on a date): #include <GUIConstantsEx.au3> #include "_CalendarUDF.au3" Opt("GUIOnEventMode", 1) Global $GUI, $fStartMonday = False, $iGridSize = 1, $sTheme = "Blue" _Main() Func _Main() Local $GUI = GUICreate("Calendar example", 800, 600, -1, -1, BitOR($WS_SYSMENU, $WS_SIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetState() GUICtrlCreateButton("Toggle grid", 20, 10, 150, 20) GUICtrlSetOnEvent(-1, "Btn_ToggleGrid") GUICtrlCreateButton("Toggle Start Mon/Sun", 170, 10, 150, 20) GUICtrlSetOnEvent(-1, "Btn_ToggleMondaySunday") GUICtrlCreateButton("Go to Date", 320, 10, 150, 20) GUICtrlSetOnEvent(-1, "Btn_GoToDate") GUICtrlCreateButton("Add Event", 470, 10, 150, 20) GUICtrlSetOnEvent(-1, "Btn_AddEvent") GUICtrlCreateButton("Switch theme", 620, 10, 150, 20) GUICtrlSetOnEvent(-1, "Btn_SwitchTheme") ;Create the calendar control: _GuiCtrlCal_Create("My Calendar", 20, 40, 760, 520, @MON, @YEAR, 30, $fStartMonday, $iGridSize) ;Register my function, called when I double click a date: _GuiCtrlCal_OnDateDblClickRegister("_MyFunction") ;Add some Events: _GuiCtrlCal_EventAdd("2012/12/01", "World AIDS Day") _GuiCtrlCal_EventAdd("2012/12/25", "Christmas") _GuiCtrlCal_EventAdd("2012/12/21", "Winter Solstice") _GuiCtrlCal_EventAdd("2012/12/10", "Human Rights day") _GuiCtrlCal_EventAdd("2012/12/31", "Happy new year") _GuiCtrlCal_EventAdd("2013/01/11", "Human Trafficking Awareness") _GuiCtrlCal_EventAdd("2013/01/26", "Australia Day") ;Loop: While 1 Sleep(50) WEnd EndFunc ;This function will now be called when I doubleclick on a date. ;This function has to have one parameter that will contain ;the selected date: Func _MyFunction($sDate) ;The selected date is $sDate ConsoleWrite("Selected date is: " & $sDate & @CRLF) ;Create a small gui to input a text for the event: Local $mousePos = MouseGetPos() Local $GUIAddEvent = GUICreate("Add Event", 250, 50, $mousePos[0] - 125, $mousePos[1] - 15, $WS_POPUP, $WS_EX_TOPMOST, $GUI) GUISetState(@SW_SHOW, $GUIAddEvent) Local $Info = GUICtrlCreateLabel("Enter a text and press enter to add the event", 0, 0, 250, 15) Local $GUIAddEvent_Input = GUICtrlCreateInput("", 0, 15, 250, 35) GUICtrlSetState($GUIAddEvent_Input, $GUI_FOCUS) ;Wait for the user to press enter: While 1 If _IsPressed("0D") Then Do Sleep(10) Until Not _IsPressed("0D") ExitLoop EndIf Sleep(50) WEnd ;Read the text: Local $sText = GUICtrlRead($GUIAddEvent_Input) If $sText = "" Then Return GUIDelete($GUIAddEvent) ;Add the event: _GuiCtrlCal_EventAdd($sDate, $sText) EndFunc Func _Exit() _GuiCtrlCal_Destroy() Exit EndFunc Func Btn_ToggleGrid() If $iGridSize = 0 Then $iGridSize = 1 Else $iGridSize = 0 EndIf _GuiCtrlCal_SetGridSize($iGridSize) _GuiCtrlCal_Refresh() EndFunc Func Btn_ToggleMondaySunday() $fStartMonday = Not $fStartMonday _GuiCtrlCal_SetStartMonday($fStartMonday) _GuiCtrlCal_Refresh() EndFunc Func Btn_GoToDate() Local $sDate = InputBox("Go to Date", "Input the year, month and day : YYYY/MM/DD", @YEAR & "/" & @MON & "/" & @MDAY) If $sDate <> "" Then Local $aDate = StringSplit($sDate, "/") If Not @error Then _GuiCtrlCal_GoToMonth($aDate[1], $aDate[2]) _GuiCtrlCal_SetSelectedDate($sDate) EndIf EndIf EndFunc Func Btn_AddEvent() Local $sDateEvent = InputBox("Event Date", "Input the year, month and day (YYYY/MM/DD) for your event", @YEAR & "/" & @MON & "/" & @MDAY) If $sDateEvent = "" Then Return Local $sText = InputBox("Event Text", "Input the Text for your event", "My Event") If $sText = "" Then Return _GuiCtrlCal_EventAdd($sDateEvent, $sText) EndFunc Func Btn_SwitchTheme() Switch $sTheme Case "Blue" $sTheme = "Dark" _GuiCtrlCal_SetThemeDark() Case "Dark" $sTheme = "Blue" _GuiCtrlCal_SetThemeBlue() EndSwitch EndFunc And here is the UDF: _CalendarUDF.au3
    1 point
  6. wakillon

    Chiptunes Players

    I love chiptune music, but BASS only support XM, IT, S3M, MOD, MTM, UMX and MO3 file format for MOD music. 1 | Nintendo NES and SNES Sound File Players May be you already have some files with extension nsf, nsfe, spc or rsn (unzip rsn files for get spc collection files inside) but you can't play them in a AutoIt script ? So I searched around a bit, and found 2 DLL ( nsf_player.dll and spc_player.dll ) for play Nintendo NES and SNES Sound Files. Interest of those DLL is that they can play from file path or binary data, avoiding temp files. Dll and audio files are embedded in scripts for permit you to test them right away. Some info/download links are in front of each script. 2 | ModPlug Player Another dll found : npmod32.dll who support mod, s3m, xm, med, it, s3z, mdz, itz, xmz and wav files. Interest : it can play some rares chiptune formats, you can also pause, set volume and set position. Inconvenient : do not load from binary datas. Dll and audio files are embedded in script and i have added a gui for permit you to try right away ! Warning : Do not work on Win8. 3 | ZXTune Player 2 (basszxtune.dll v2.4.5) UPDATE of 23 DEC 2016 Using BASSZXTUNE chiptune support for BASS ( Support as0, asc, ay, ftc, gtr, psc, psg, psm, pt1, pt2, pt3, sqt, st1, s, st3, stc, stp, ts, txt, vtx, ym, chi, dmm, dst, m, sqd, str, sid, cop, tf0, tfc, tfd, tfe, $b, $m, ahx, ayc, bin, cc3, d, dsq, esv, fdi, gam, gamplus, gbs, gym, hes, hrm, hrp, lzs, msp, mtc, nsf, nsfe, p, pcd, sap, scl, spc, szx, td0, tlz, tlzp, trd, trs, vgm ) Interest : it can play lot of rares chiptune formats, while benefiting from all bass functions. Inconvenient : dll size.(5860ko) Dll and audio files are embedded in script. 4 | TitchySID Player Files and dll are loaded in memory. Interest : dll size (8ko), you can Play/Stop/Pause/Resume and choose which subsong to play. Inconvenient : only SID audio files supported ( PSID & RSID) Dll and audio files are embedded in script. Tested under Win7 and Win8. Edit : added a Sid header viewer : SidHeaderViewer.au3 5 | MiniFmod Player Interest : dll size (20ko) Inconvenient : only xm audio files supported. 6 | Npnez Player Using npnez.dll (88ko) for play Gameboy Sound System audio files and some others ( kss, hes, nsf, ay, gbr, gbs, gb, nsd, sgc ) Interest : Can be loaded in memory, subsong can be set and volume can be adjusted ( perfect for create a fade when exiting ) Inconvenient : for an unknow reason, only 20% of my hes collection is playable... 7 | µFMOD Player Interest : dll size (10ko), can be loaded in memory, support Play/Stop/Pause/Resume actions and volume can be adjusted ( perfect for create a fade when exiting ) Inconvenient : only xm audio files supported. 8 | MagicV2m Player Interest : dll size (20ko), Play/Stop/IsPlay/SetAutoRepeat/Progress Inconvenient : only v2m audio files supported, V2mPlayStream is not reliable, so prefer V2mPlayFile instead. 9 | OSMEngine Player OSMEngine.dll (80 ko)(Oldskool Musics Engine) permit to play snd, sndh, fc, fc4, fc14 and some rare jam audio files from Amiga/Atari ST(E) Interest : audio can be loaded in memory, and Pause/Resume/SetVolume/GetInfos are available Inconvenient : none at the moment. 10 | Ayfly Player Ayfly.dll (268 ko) is a AY-891x emulator and player who support the following tracker formats : aqt, asc, ay, fxm, gtr, psc, psg, pt1, pt2, pt3, sqt, stc, stp, vtx, ym and zxs (ZX Spectrum Emulator Snapshot) files. Interest : SetVolume/GetInfos are available Inconvenient : a function named "ay_initsongindirect" for load module in memory exists, but due to the poor documentation provided i do not succeed to get it to work... 11 | GMGME Player GMGME.dll is a emulated music DLL that allows you to play ay, gbs, gym, hes, kss, nsf/nsfe, sap, spc and vgm files. Interest : Can play ATARI SAP files (only type B and C) , Set Volume and Set Tempo are available Inconvenient : Dll Size (and his imports) , and audio files can not be loaded in memory. 12 | SC68 Player sc68replay.dll (166 ko) is a Freebasic DLL compiled from "sc68replay" src that allows you to play SC68 (Atari ST and Amiga audio formats) files. Interest : Can play from file and memory Inconvenient : Unfortunatelly for an unknown reason not all sc68 files are supported. 13 | Extended Module Player LibXmp.dll (272 ko) can "read" xm, mod, it, s3m, med, 669 but also some rares formats abk, amd, amf, dbm, digi, dtm, emod, far, flx, fnk, gdm, hsc, imf, j2b, liq, m15, mdl, mfp, mgt, mtm, mtn, okt, psm, ptm, rad, rtm, sfx, smp, stim, stm, stx, ult, umx, wow, ym3812 Despite its name, it's not a "player" but a library that renders module files to RAW PCM data. So the interest in this script was to find a way to convert those raw datas into a "playable" sound. With Waveform Audio Interface i create a pseudo Wav header who permit to play datas as a Wav file. Interest : Can play from file and memory Inconvenient : Time to render datas (depends of file size) 14 | LibModPlug Player LibModPlug.dll (102 ko) can "read" xm, it, mod, s3m, med, 669 and also amf, ams, dbm, dmf, dsm, far, j2b, mdl, mt2, mtm, okt, psm, ptm, stm, ult, umx. As LibXmp.dll, it's a library that renders module files to RAW PCM data. For this one, i create a real binary wave header for be able to play it easily from memory with winmm.dll PlaySoundW function. Interests : Can play from file and memory, and have some nice sound effects : Surround, MegaBass and Reverb (used in script example) It can also replace modplug player(2) for Win 8+ users Inconvenient : Time to render datas (depends of file size) 15 | AdPlug Player AdPlug.dll ( 69ko ) is an AdLib sound player library who is able to play the following files type : A2M, ADL, AMD, BAM, CFF, CMF, D00, DFM, DMO, DRO, DTM, HSC, HSP, IMF, KSM, LAA, LDS, M, MAD, MID, MKJ, MSC, MTK, RAD, RAW, RIX, ROL, S3M, SA2, SAT, SCI, SNG, XAD, XMS, XSM For this one, time to render datas is to long, so i needed to find an other way for play modules. Using Bass.dll and particulary the "BASS_StreamPutData" function i succeeded to play module in loop while rendering it. Both DLL are loaded in memory, and 16 different module types are available in the script. No includes/files needed. Just run it. Warning : for a unique file extension (example .sng), it's sometimes possible to have several filetypes from different trackers ! AdPlug.dll Imports : msvcp71.dll, msvcr71.dll in C:\Windows\SysWOW64 ( VC Redist Installer ) Interests : Can read some obscure rare formats. Inconvenient : Can not read from memory 16 | LibMikmod Player LibMikmod.dll (85ko) will currently play the following common and not so common formats : 669, AMF, DSM, FAR, GDM, IMF, IT, MED, MOD, MTM, S3M, STM, STX, ULT, UNI, XM Interests : Can load from memory Inconvenient : only for full-screen applications, because if the application has not the focus sound is muted Downloads are available in the download section Dedicated to chiptune Lovers ! Music Links : asma.atari.org woolyss.com chipmusic.org demozoo.org modarchive.org modules.pl keygenmusic.net zxtunes.com mazemod.org amigaremix.com pouet.net plopbox.eu Modland
    1 point
  7. MarksRobert

    Over moderation

    Common sense is something shared, it doesn't work one way. Hence "common." A. Forums belong to the community as a whole (which of course includes mods). Good moderation is a servant leader role, it wouldn't kill you to be friendly. B. I've pointed out three bugs in your system that together make the rules absolutely impossible for a new forum member to adhere (aside from sheer luck). I'm trying to nicely "suggest" you fix them, and also recommended some small changes to improve usability for new community members. Jumping down my throat and making ridiculous presumptions about my ability to make friends is uncalled for and off-topic. But yes, you have a good point: I should clearly go elsewhere. I'll do that, thanks.
    1 point
  8. SciTE 3.2.5.99 updated, added SciTE Theme Manager (SciTEConfig replacement) and fixed few bugs. Screenshots
    1 point
  9. AutoIt comes with some timer functions. Check the help file for TimerInit and TimerDiff.
    1 point
  10. jchd

    CSVSplit

    Feel free: ideas don't come with a copyright.
    1 point
  11. Jon

    Forum Roll Back

    There's some trouble with the forum database. I've had to roll back to the backup made on the morning of the 21st March.  Posts between 6am->12pm (UK time) will be gone. I need to do some more checks and fixes but I've spent all day trying to get it back up to the current state so I need to sleep and do some more health checks tomorrow.
    1 point
  12. jchd

    CSVSplit

    There are countless variations departing from the CSV RFC 4180 and I've yet to see a CSV processor implementing strictly all of the RFC possibilities and options. I also find it unfortunate that there is no provision for denoting NULL, which is a fundamental "nonvalue" used in SQL tables. Having a way to round-trip SQLite tables to/from CSV to/from AutoIt arrays to/from AutoIt maps without damage was a requisite for me some time ago, at least that was what I thought! That's why I started to write my own set of functions for that. Ironically I never finished the SQLite part and never actually needed it routinely enough to justify taking over the extra step. If someone is interessed (beta required, for maps), here it is (with all possible viciously hidden bugs included): ; MAC.au3 ; conversions between Map, Array, Csv ; unsorted notes: ; these functions convert: ; AutoIt arrays to/from a CSV-style string ; AutoIt maps to/from a CSV-style string ; AutoIt arrays to/from AutoIt maps ; it is caller responsability to supply: ; a variable (0 to 2 dimensions) to _ArrayToCsv and _ArrayToMap, ; a valid map to _MapToArray and _MapToCsv, ; a Unicode CSV-style string to _CsvToArray and _CsvToMap. ; flags: 1 forces transposition ; require 3.3.10+ ; ; these functions are built to preserve basic types (where possible). ; CSV syntax rules: ; - no header line ; - rows terminated by CR or LF or CRLF (optional on the last line) ; - values separated by commas, possibly preceeded and/or followed by whitespaces (ignored) ; - Unicode ; - every string value must be enclosed in double-quotes ; - double-quotes within a string need to be doubled ; - CR, LF & CRLF may be embedded in string fields ; - integers and floating-point may be signed (but 0 = +0 = -0 = 0.0 = +0.0 = -0.0 i.e. sign of zero is not preserved in round-trip) ; - binary values take the form 0x0123456789ABCDEF ; - pointers are encoded as @0x123456789 ; - hWnd are encoded as *0x123456789 ; - a Null is represented by an empty field or the value Null ; - {False, True} mapped to boolean ; - binary values enclosed in curly brakets represent structure contents ; - value Default represents keyword Default ; - a [user]function reference takes the form MYFUNCTION() ; - the value <-invalid-> represents an invalid value (generally created from conversion of an untranslatable type in source array) ; Array types (input of flat variables and 1D arrays are OK and converted to 2D): ; - string ; - integer ; - double ; - binary ; - boolean mapped to {False,True} ; - keyword Default mapped to value Default ; - keyword Null mapped to value Default ; - ptr and hWnd are converted to corresponding types (exporting these is probably useless) ; - structures: content mapped to structure of bytes enclosed in curly brakets ; - functions references e.g. reference to function xyz are converted to XYZ() ; - other untranslatable types (arrays, maps, objects) mapped to value <-invalid-> ; Maps: ; - when converting to map, CSV or Array will need 1 or more column: ; - when only one column exists in the input, map entries will use keys numbered from 0 ; - when two or more column exist in the input, the first column will be the keys and the second will be associated items (unless transposed) ; - when the key read from array or CSV is an integer, the item will be created with an integer key ; else the key read off array or CSV will be translated to a string Global Const $_MAC_INVALID = '<-invalid->' Func _ArrayToCsv($aIn, $bFlags = 0) Switch UBound($aIn, 0) Case 0 Local $aIn1[1] = [$aIn] $aIn = $aIn1 ContinueCase Case 1 Local $aIn2[UBound($aIn)][1] For $i = 0 To UBound($aIn) - 1 $aIn2[$i][0] = $aIn[$i] Next $aIn = $aIn2 ContinueCase Case 2 Local $sline, $sOut If BitAND($bFlags, 1) Then ; transpose ? For $i = 0 To UBound($aIn, 2) - 1 $sline = '' For $j = 0 To UBound($aIn, 1) - 2 $sline &= __CsvValueEncode($aIn[$j][$i]) & ',' Next $sOut &= $sline & __CsvValueEncode($aIn[UBound($aIn, 1) - 1][$i]) & @CRLF Next Else For $i = 0 To UBound($aIn, 1) - 1 $sline = '' For $j = 0 To UBound($aIn, 2) - 2 $sline &= __CsvValueEncode($aIn[$i][$j]) & ',' Next $sOut &= $sline & __CsvValueEncode($aIn[$i][UBound($aIn, 2) - 1]) & @CRLF Next EndIf Case Else Return SetError(1, 0, 0) EndSwitch Return $sOut EndFunc Func _CsvToArray(ByRef $sIn, $bFlags = 0) Local Const $kField = ' ( (?:".*?")+ | [@*{]?0x[[:xdigit:]]+\}? | [+-]?\d*\.?\d+(?:E[+-]?\d+)? | True | False | Null | Default | \w+\(\) | ' & $_MAC_INVALID & ' | (?<=,|^)\h*(?=,|$) ) ' Local $aLine = StringRegExp($sIn, '(?imsx)((?:\h*' & $kField & '\h*,?)+)\R?', 1) Local $aFields = StringRegExp($aLine[0], '(?imsx)' & $kField, 3) Local $iCols = UBound($aFields) StringRegExpReplace($sIn, '(?imsx)((?:\h*' & $kField & '\h*)(?:,\h*' & $kField & '\h*){' & $iCols - 1 & '}\R?)', '') Local $iRows = @extended Local $iOfs = 1 If BitAND($bFlags, 1) Then ; transpose ? Local $aOut[$iCols][$iRows] Else Local $aOut[$iRows][$iCols] EndIf Local $vField For $i = 0 To $iRows - 1 $aLine = StringRegExp($sIn, '(?imsx)((?:\h*' & $kField & '\h*,?)+)\R?', 1, $iOfs) $iOfs = @extended $aFields = StringRegExp($aLine[0], '(?imsx)' & $kField, 3) For $j = 0 To $iCols - 1 $vField = $aFields[$j] Select Case StringLeft($vField, 1) = '"' $vOut = StringReplace(StringMid($vField, 2, StringLen($vField) - 2), '""', '"') Case StringRegExp($vField, '^0x[[:xdigit:]]+$') $vOut = Binary($vField) Case StringRegExp($vField, '(?i)^[+-]?\d*\.?\d+(?:e[+-]?\d+)?$') $vOut = Number($vField) Case $vField = '' Or $vField = 'Null' Or StringRegExp($vField, '^\h+$') $vOut = Null Case $vField = 'True' $vOut = True Case $vField = 'False' $vOut = False Case StringRegExp($vField, '^[@*]0x[[:xdigit:]]+$') Local $ptr = Ptr(StringTrimLeft($vField, 1)) If StringMid($vField, 1, 1) = '@' Then $vOut = IsHWnd(HWnd($ptr)) ? HWnd($ptr) : $ptr Else $vOut = $ptr EndIf Case StringRegExp($vField, '^\{0x[[:xdigit:]]+\}$') $vField = Binary(StringMid($vField, 2, StringLen($vField) - 2)) Local $tStruct = DllStructCreate('byte[' & BinaryLen($vField) & ']') DllStructSetData($tStruct, 1, $vField) $vOut = $tStruct Case $vField = 'Default' $vOut = Default Case StringRegExp($vField, '^\w+\(\)$') $vOut = Execute(StringTrimRight($vField, 2)) Case Else $vOut = $_MAC_INVALID EndSelect If BitAND($bFlags, 1) Then ; transpose ? $aOut[$j][$i] = $vOut Else $aOut[$i][$j] = $vOut EndIf Next Next Return $aOut EndFunc Func __CsvValueEncode(ByRef $vVar) Select Case IsInt($vVar) Or IsBool($vVar) Or IsBinary($vVar) Or IsKeyword($vVar) Or $vVar = $_MAC_INVALID Return $vVar Case IsString($vVar) Return '"' & StringReplace($vVar, '"', '""') & '"' Case VarGetType($vVar) = "Double" Return $vVar & (IsInt($vVar) ? '.0' : '') Case IsFunc($vVar) Return FuncName($vVar) & '()' Case IsHWnd($vVar) Return '@' & $vVar Case IsPtr($vVar) Return '*' & $vVar Case IsDllStruct($vVar) Local $tStruct = DllStructCreate('byte[' & DllStructGetSize($vVar) & ']', DllStructGetPtr($vVar)) Return '{' & DllStructGetData($tStruct, 1) & '}' Case Else Return $_MAC_INVALID EndSelect EndFunc Func _ArrayToMap(ByRef $aIn, $bFlags = 0) Local $mOut[] Switch UBound($aIn, 0) Case 0 $mOut[0] = $aIn Case 1 For $i = 0 To UBound($aIn) - 1 $mOut[$i] = $aIn[$i] Next Case 2 For $i = 0 To UBound($aIn, 1) - 1 If BitAND($bFlags, 1) Then ; transpose ? Switch VarGetType($aIn[$i][1]) Case "Int32", "Int64" $mOut[$aIn[$i][1]] = $aIn[$i][0] Case Else $mOut[String($aIn[$i][1])] = $aIn[$i][0] EndSwitch Else Switch VarGetType($aIn[$i][0]) Case "Int32", "Int64" $mOut[$aIn[$i][0]] = $aIn[$i][1] Case Else $mOut[String($aIn[$i][0])] = $aIn[$i][1] EndSwitch EndIf Next Case Else Return SetError(1, 0, 0) EndSwitch Return $mOut EndFunc Func _MapToArray(ByRef $mIn, $bFlags = 0) If BitAND($bFlags, 1) Then ; transpose ? Local $aOut[2][UBound($mIn)] Else Local $aOut[UBound($mIn)][2] EndIf Local $i = 0 For $key In Mapkeys($mIn) If BitAND($bFlags, 1) Then ; transpose ? $aOut[0][$i] = $key $aOut[1][$i] = $mIn[$key] Else $aOut[$i][0] = $key $aOut[$i][1] = $mIn[$key] EndIf $i += 1 Next Return $aOut EndFunc Func _CsvToMap(ByRef $sIn) Local $mOut[] Local Const $kField = ' ( (?:".*?")+ | [@*{]?0x[[:xdigit:]]+\}? | [+-]?\d*\.?\d+(?:E[+-]?\d+)? | True | False | Null | Default | \w+\(\) | ' & $_MAC_INVALID & ' | (?<=,|^)\h*(?=,|$) ) ' Local $aLine = StringRegExp($sIn, '(?imsx)((?:\h*' & $kField & '\h*,?)+)\R?', 1) Local $aFields = StringRegExp($aLine[0], '(?imsx)' & $kField, 3) Local $iCols = UBound($aFields) StringRegExpReplace($sIn, '(?imsx)((?:\h*' & $kField & '\h*)(?:,\h*' & $kField & '\h*){' & $iCols - 1 & '}\R?)', '') Local $iRows = @extended Local $iOfs = 1 Local $vField Local $vKey For $i = 0 To $iRows - 1 $aLine = StringRegExp($sIn, '(?imsx)((?:\h*' & $kField & '\h*,?)+)\R?', 1, $iOfs) $iOfs = @extended $aFields = StringRegExp($aLine[0], '(?imsx)' & $kField, 3) If StringRegExp($aFields[0], "^[+-]?\d+$") Then $vKey = Int($aFields[0]) Else $vKey = StringReplace(StringMid($aFields[0], 2, StringLen($aFields[0]) - 2), '""', '"') ; whatever that gives! EndIf $vField = $aFields[1] Select Case StringLeft($vField, 1) = '"' $mOut[$vKey] = StringReplace(StringMid($vField, 2, StringLen($vField) - 2), '""', '"') Case StringRegExp($vField, '^0x[[:xdigit:]]+$') $mOut[$vKey] = Binary($vField) Case StringRegExp($vField, '(?i)^[+-]?\d*\.?\d+(?:e[+-]?\d+)?$') $mOut[$vKey] = Number($vField) Case $vField = '' Or $vField = 'Null' Or StringRegExp($vField, '^\h+$') $mOut[$vKey] = Null Case $vField = 'True' $mOut[$vKey] = True Case $vField = 'False' $mOut[$vKey] = False Case StringRegExp($vField, '^[@*]0x[[:xdigit:]]+$') Local $ptr = Ptr(StringTrimLeft($vField, 1)) If StringMid($vField, 1, 1) = '@' Then $mOut[$vKey] = IsHWnd(HWnd($ptr)) ? HWnd($ptr) : $ptr Else $mOut[$vKey] = $ptr EndIf Case StringRegExp($vField, '^\{0x[[:xdigit:]]+\}$') $vField = Binary(StringMid($vField, 2, StringLen($vField) - 2)) Local $tStruct = DllStructCreate('byte[' & BinaryLen($vField) & ']') DllStructSetData($tStruct, 1, $vField) $mOut[$vKey] = $tStruct Case $vField = 'Default' $mOut[$vKey] = Default Case StringRegExp($vField, '^\w+\(\)$') $mOut[$vKey] = Execute(StringTrimRight($vField, 2)) Case Else $mOut[$vKey] = $_MAC_INVALID EndSelect Next Return $mOut EndFunc Func _MapToCsv(ByRef $mIn, $bFlags = 0) If BitAND($bFlags, 1) Then ; transpose ? Local $sOut, $sline For $key In Mapkeys($mIn) $sOut &= __CsvValueEncode($key) & ',' $sline &= __CsvValueEncode($mIn[$key]) & ',' Next Return StringTrimRight($sOut, 1) & @CRLF & StringTrimRight($sline, 1) & @CRLF Else Local $sOut For $key In Mapkeys($mIn) $sOut &= __CsvValueEncode($key) & ',' & __CsvValueEncode($mIn[$key]) & @CRLF Next Return $sOut EndIf EndFunc ; example use #cs #include "..\include\dump.au3" Local $a[3][2] = [ _ [3.1415926, Ptr(0x12345678)], _ ["ab""c", -1], _ [WinGetHandle(AutoItWinGetTitle()), Null] _ ] Local $out = _ArrayToMap($a) _consolewrite(_vardump($out) & @LF) Local $aa = _MapToArray($out) _consolewrite(_vardump($aa) & @LF) Local $csv = _MapToCsv($out) _ConsoleWrite($csv & @LF) Local $mm = _CsvToMap($csv) _consolewrite(_vardump($mm) & @LF) Func _ConsoleWrite($s) ConsoleWrite(BinaryToString(StringToBinary($s, 4), 1)) EndFunc ;~ Exit #ce #include <Array.au3> Local $s = "@" & WinGetHandle(AutoItWinGetTitle()) & ", 55.456e-8, *" & Ptr(0x12345678) & ",,"""",StringLen()" & ',"abc ""123"" def"' ConsoleWrite($s & @LF) Local $a = _CsvToArray($s) _ArrayDisplay($a) For $i = 0 To UBound($a, 2) - 1 ConsoleWrite(VarGetType($a[0][$i]) & " = " & ($a[0][$i] = Null ? "Null" : $a[0][$i]) & @LF) Next Local $t = _ArrayToCsv($a) ConsoleWrite($t & @LF)
    1 point
  13. Hi, Hope this helps : Br, FireFox.
    1 point
  14. Melba23

    Forum behaviour

    A recent thread degenerated into personal abuse because some members posted rather sarcasticly in response to the initial question and the OP then responded with rather more venom than was probably warranted. Can I take this opportunity to remind people that we try to run a civilised and polite forum and we would appreciate it if you could act accordingly. If you do not have a sensible comment to make in response to a question, please refrain from posting at all. And, as is explained in the Forum rules, if you do get flamed just report the offending post to the moderating team so that we can deal with it. Certainly do not expect us to take sides if you engage in a flame war - all participants will be treated as equally guilty. Basically, please help us keep the forum running in the way the majority of members would like to see. Thanks in advance for your cooperation. M23
    1 point
  15. omgplshelpme, Have a week's holiday to reflect on how to conduct yourself in public forums. When and if you return, behave in a reasonable fashon or you will be removed permanently. M23 P.S. And If they bother to ask I will give them your IP as well.
    1 point
  16. Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".
    1 point
  17. Kidney, I would use a double-click for this - ListBoxes and ListViews have a nasty habit of eating single-clicks. You can do something like this to action the double-click: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListBox.au3> $hGUI = GUICreate("Test", 500, 500) $cList_1 = GUICtrlCreateList("", 10, 10, 200, 200) GUICtrlSetData($cList_1, "1|2|3|4") $cList_2 = GUICtrlCreateList("", 260, 10, 200, 200) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word $iCode = BitShift($wParam, 16) ; Hi Word Switch $iCode Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box Switch $iIDFrom Case $cList_1 $iIndex = _GUICtrlListBox_GetCaretIndex($cList_1) $sText = _GUICtrlListBox_GetText($cList_1, $iIndex) _GUICtrlListBox_DeleteString($cList_1, $iIndex) _GUICtrlListBox_AddString($cList_2, $sText) EndSwitch EndSwitch EndFunc All clear? Please ask if not. M23
    1 point
  18. for this error type i use a simple method : $_Run = "notepad.exe" & $sTextFile ConsoleWrite ( "$_Run : " & $_Run & @Crlf ) Run ( $_Run, @WindowsDir, @SW_MAXIMIZE ) With ConsoleWrite you'll see that space is missing !
    1 point
×
×
  • Create New...