Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/08/2025 in all areas

  1. mr-es335

    Data-To-Arrays

    iao747, Please, believe me when I say, "ioa747! You have the best examples of anyone here on the Forum!!" I sincerely believe that such examples are both "methodical" and "bite-sized" - just enough to "...use your little grey cells mon ami!" [Click_Me]
    1 point
  2. ioa747

    Data-To-Arrays

    #include <Array.au3> ;RegWrite ( "keyname" [, "valuename", "type", value] ) ; [4 row] [4 column] ; columns: keyname, valuename, type, value Local $Array[4][4] = [ _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "showInteractiveHelp", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "showWelcomeHint", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "LicenseText", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "Product", "REG_DWORD", "00000000"]] ;~ _ArrayDisplay($Array, "") For $i = 0 To UBound($Array) - 1 ConsoleWrite("RegWrite (" & $Array[$i][0] & ", " & $Array[$i][1] & ", " & $Array[$i][2] & ", " & $Array[$i][3] & ")" & @CRLF) Next
    1 point
  3. ioa747

    Data-To-Arrays

    3D array ; 3D array [table][row][column] Local $aProducts[3][4][4] = [ _ [ _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "showInteractiveHelp", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "showWelcomeHint", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "LicenseText", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-MB\1.0", "Product", "REG_DWORD", "00000000"] _ ], [ _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-Q\3.0", "showInteractiveHelp", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-Q\3.0", "showWelcomeHint", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-Q\3.0", "LicenseText", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-Q\3.0", "Product", "REG_DWORD", "00000000"] _ ], [ _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-R\2.0", "showInteractiveHelp", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-R\2.0", "showWelcomeHint", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-R\2.0", "LicenseText", "REG_DWORD", "00000000"], _ ["HKEY_CURRENT_USER\Software\FabFilter\Pro-R\2.0", "Product", "REG_DWORD", "00000000"] _ ]] For $t = 0 To UBound($aProducts) - 1 ;table ConsoleWrite("Part" & $t & @CRLF) For $r = 0 To UBound($aProducts, 2) - 1 ;row For $c = 0 To UBound($aProducts, 3) - 1 ;column ConsoleWrite($aProducts[$t][$r][$c] & " - ") Next ConsoleWrite(@CRLF) Next Next
    1 point
  4. ioa747

    Data-To-Arrays

    #include <Array.au3> Local $Array[4][4] For $i = 0 To UBound($Array) - 1 For $j = 0 To UBound($Array, 2) - 1 $Array[$i][$j] = $i & ":" & $j Next Next ConsoleWrite("$Array[3][3]=" & $Array[3][3] & @CRLF)
    1 point
  5. water

    Data-To-Arrays

    I had a quick look at the Excel-File you posted. OMG - Can you please tell me why you store it this way? I have never seen something like this before.
    1 point
  6. If you consider yourself a "Rookie" Then I would say that I'm really pushing it to call myself a "beginner" ! LOL Thanks for all your feedback so far!! You are right about this Autoit community! I have been working with Autoit for years now (So you would think that I would be a better coder by now) and have seen the capability of Autoit improve many times over on what it can do...and how it does it! I will have a look at that 'Ternary operator' . Thanks again for your help...
    1 point
  7. water

    Data-To-Arrays

    The Array UDF offers function _ArrayTranspose. Excel offers the Transpose method (e.g. $oExcel.Transpose). Should be a good starting point
    1 point
  8. If the master volume of my audio device was muted for whatever reason when I started my media player, I would wonder for a moment if something was wrong. So I came up with this code based on what @wraithdu wrote many years ago. I will place this code just before playing the first file so that the master volume is unmuted on startup. Opt("WinTitleMatchMode", 2) If ProcessExists("sndvol.exe") Then ProcessClose("sndvol.exe") EndIf Run(@SystemDir & "\sndvol.exe") $hWnd = WinWaitActive("Mixer") $aPos = WinGetPos($hWnd) WinMove("Mixer", "", (@DesktopWidth - $aPos[2])/2, 0) $bMute = _MasterVolume("GetMute") $sMsg = ($bMute = 1) ? ('muted!') : ('not muted!') $sMsg = 'Audio device is ' & $sMsg & @CRLF & 'Please watch how the Windows volume mixer changes.' MsgBox(0, 'Mute state', $sMsg) If $bMute = 0 Then _MasterVolume("Mute") Sleep(3000) _MasterVolume("UnMute") Else _MasterVolume("UnMute") Sleep(3000) _MasterVolume("Mute") EndIf Func _MasterVolume($action) ; https://www.autoitscript.com/forum/topic/84834-control-vista-master-volume/ Local Const $CLSID_MMDeviceEnumerator = "{BCDE0395-E52F-467C-8E3D-C4579291692E}" Local Const $IID_IMMDeviceEnumerator = "{A95664D2-9614-4F35-A746-DE8DB63617E6}" Local Const $tagIMMDeviceEnumerator = _ "EnumAudioEndpoints hresult(int;dword;ptr*);" & _ "GetDefaultAudioEndpoint hresult(int;int;ptr*);" & _ "GetDevice hresult(wstr;ptr*);" & _ "RegisterEndpointNotificationCallback hresult(ptr);" & _ "UnregisterEndpointNotificationCallback hresult(ptr)" Local Const $IID_IMMDevice = "{D666063F-1587-4E43-81F1-B948E807363F}" Local Const $tagIMMDevice = _ "Activate hresult(struct*;dword;ptr;ptr*);" & _ "OpenPropertyStore hresult(dword;ptr*);" & _ "GetId hresult(wstr*);" & _ "GetState hresult(dword*)" Local Const $eRender = 0, $eConsole = 0 Local Const $IID_IAudioEndpointVolume = "{5CDF2C82-841E-4546-9722-0CF74078229A}" Local Const $tagIAudioEndpointVolume = _ "RegisterControlChangeNotify hresult(ptr);" & _ "UnregisterControlChangeNotify hresult(ptr);" & _ "GetChannelCount hresult(uint*);" & _ "SetMasterVolumeLevel hresult(float;ptr);" & _ "SetMasterVolumeLevelScalar hresult(float;ptr);" & _ "GetMasterVolumeLevel hresult(float*);" & _ "GetMasterVolumeLevelScalar hresult(float*);" & _ "SetChannelVolumeLevel hresult(uint;float;ptr);" & _ "SetChannelVolumeLevelScalar hresult(uint;float;ptr);" & _ "GetChannelVolumeLevel hresult(uint;float*);" & _ "GetChannelVolumeLevelScalar hresult(uint;float*);" & _ "SetMute hresult(int;ptr);" & _ "GetMute hresult(int*);" & _ "GetVolumeStepInfo hresult(uint*;uint*);" & _ "VolumeStepUp hresult(ptr);" & _ "VolumeStepDown hresult(ptr);" & _ "QueryHardwareSupport hresult(dword*);" & _ "GetVolumeRange hresult(float*;float*;float*)" Local $oIAudioEndpointVolume = 0;, $err = 1 ; create device enumerator interface Local $oDevEnum = ObjCreateInterface($CLSID_MMDeviceEnumerator, $IID_IMMDeviceEnumerator, $tagIMMDeviceEnumerator) If IsObj($oDevEnum) Then ; get default audio endpoint interface pointer Local $pDefaultDevice = 0 If $oDevEnum.GetDefaultAudioEndpoint($eRender, $eConsole, $pDefaultDevice) >= 0 Then ; create default audio endpoint interface Local $oIMMDevice = ObjCreateInterface($pDefaultDevice, $IID_IMMDevice, $tagIMMDevice) If IsObj($oIMMDevice) Then ; get endpoint volume interface pointer Local $pEndpointVolume = 0 Local $tGUID = DllStructCreate("ulong Data1;ushort Data2;ushort Data3;byte Data4[8]") DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $IID_IAudioEndpointVolume, "struct*", $tGUID) If $oIMMDevice.Activate($tGUID, 1, 0, $pEndpointVolume) >= 0 Then ; create endpoint volume interface $oIAudioEndpointVolume = ObjCreateInterface($pEndpointVolume, $IID_IAudioEndpointVolume, $tagIAudioEndpointVolume) EndIf $oIMMDevice = 0 EndIf EndIf $oDevEnum = 0 EndIf If $action = "GetMute" Then ; Get mute state of the audio device Local $bMute = 0 $oIAudioEndpointVolume.GetMute($bMute) Return $bMute ; 0 - not muted, 1 - muted ElseIf $action = "Mute" Then ; Mute the audio device $oIAudioEndpointVolume.SetMute(1, 0) ; 1st parameter: 1 to mute, 0 to unmute ElseIf $action = "UnMute" Then ; Unmute the audio device $oIAudioEndpointVolume.SetMute(0, 0) ; 1st parameter: 1 to mute, 0 to unmute EndIf EndFunc ;==>_Audio_MasterVolume
    1 point
  9. Only use this latest version.... All the other stuff will be closed soon. This latest version has everything in it that was developed/changed in the last couple of years, including the Dynamic stuff. As soon as the release candidate is proven to be working, then all webinfo and links will be updated.
    1 point
  10. Thank you so much! Yes, that's works just fine now! I'm greatly relieved. The other codes above with loops and stuff, they're great in structure but I don't work with fancy stuff like that very well <lol>. So just fixing my syntax errors above is so very useful as I have a couple of other instances where I need this type of script and so will be able to edit it easily (primitive, but within my grasp! <g>). Here is my working script now: ; Script kindly fixed by ioa747, Posted January 2, 2025: https://www.autoitscript.com/forum/topic/212593-creating-files-from-inputbox-im-missing-something/#findComment-1539972 ; ; AutoIt 3x ; #NoTrayIcon ; AutoIt's icon doesn't show in systray TraySetIcon("Shell32.dll", 153) ; changes the icon displayed in the systray AutoItSetOption("WinTitleMatchMode", 2) ; this allows partial window titles to be valid! ;------------------------------------------------------------------------------------------------------------------------- #Region --- CodeWizard generated code Start --- ;InputBox features: Title=Yes, Prompt=Yes, Default Text=No, Input Length=4, Width=500, Height=125 If Not IsDeclared("sInputBoxAnswer") Then Local $sInputBoxAnswer $sInputBoxAnswer = InputBox("Year?","What year do you wish to create calendars for?",""," 4","500","125","250","250") Select Case @Error = 0 ;OK - The string returned is valid FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".01 - JAN " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".02 - FEB " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".03 - MAR " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".04 - APR " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".05 - MAY " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".06 - JUN " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".07 - JUL " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".08 - AUG " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".09 - SEP " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".10 - OCT " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".11 - NOV " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file FileWrite(@ScriptDir & "\" & $sInputBoxAnswer & ".12 - DEC " & $sInputBoxAnswer & " - Wall Calendar", "") ; empty file Case @Error = 1 ;The Cancel button was pushed Exit ; finished Case @Error = 3 ;The InputBox failed to open Exit ; finished EndSelect #EndRegion --- CodeWizard generated code End --- Thank you all!! And thank you, ioa747!!
    1 point
  11. I'm not very good with arrays. But maybe this will get you on the right track. With it, you crate an array. Then if you want to add a row, you need to create a second array and copy the data from the first in to it. Then append the new row into the second array. #include <Array.au3> Local $avArray[3][3], $avArray2[4][3] $avArray[0][0] = "Col1 Row1" $avArray[1][0] = "Col1 Row2" $avArray[2][0] = "Col1 Row3" $avArray[0][1] = "Col2 Row1" $avArray[1][1] = "Col2 Row2" $avArray[2][1] = "Col2 Row3" $avArray[0][2] = "Col3 Row1" $avArray[1][2] = "Col3 Row2" $avArray[2][2] = "Col3 Row3" _ArrayDisplay($avArray, "Original Array") $i = 0 $j = 0 Do $avArray2[$i][$j] = $avArray[$i][$j] ; Creates a second array and imports the data from the first. Do $j = $j + 1 $avArray2[$i][$j] = $avArray[$i][$j] Until $j = 2 $i = $i + 1 $j = 0 Until $i = 3 ; Now begins the insert of a new row $avArray2[3][0] = "Col1 Row4" $avArray2[3][1] = "Col2 Row4" $avArray2[3][2] = "Col3 Row4" _ArrayDisplay($avArray2, "Secondary Array")
    1 point
  12. water

    Data-To-Arrays

    Even without further troubleshooting information from you, the cause of the problem is fairly obvious. The solution is: Learn the basics of AutoIt! That includes arrays!
    0 points
×
×
  • Create New...