Jump to content

Search the Community

Showing results for tags 'looping'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 3 results

  1. Hello, I'm trying to make a program that can look at a folder directory, find all the CSV files, and then add the data from CSV's to an array. The problem I seem to be running into is on the 2nd iteration (2nd file) when the script will not create an array. Could someone please help? Thanks in advance #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Global $MasterArray RefineData() Func RefineData() Local $i, $filenum, $file, $csvArray, $sFilePath = @ScriptDir $fileList = _FileListToArrayRec($sFilePath, "*.csv", 1) ;Create and array of all .csv files within folder ;=====Loop through the .csv files within the folder====== For $filenum = 1 To UBound($fileList) - 1 Step 1 $file = $fileList[$filenum] $sFilePath = $sFilePath & "\" & $file ;=====Create array based on csv file===== _FileReadToArray($sFilePath, $csvArray, $FRTA_NOCOUNT, ",") _ArrayDisplay($csvArray,"File: " & $filenum) If $filenum = 1 Then $MasterArray = $csvArray _ArrayDisplay($MasterArray, "Master") Else $MasterArray = _ArrayColInsert($MasterArray, UBound($MasterArray)) ;want column added at end For $i = 0 To UBound($MasterArray)-1 Step 1 $MasterArray[$i][UBound($MasterArray) - 1] = $csvArray[$i][4] Next _ArrayDisplay($MasterArray, "Master") EndIf Next EndFunc ;==>RefineData
  2. Hello guys, I have a problem here and needed your help. I need this script to be looping when pressed a button joystick, and then loose the button to perform a function in the case when pressed any button on the joystick enter the loop and when you release the button to appear the message. thank you. #Include <GUIConstants.au3> Local $Joystick, $coor, $h, $s, $msg Local $num = 0 $Joystick = _JoyInit() Dim $labels_text[8] = ['X', 'Y', 'Z', 'R', 'U', 'V', 'POV', 'Buttons'] Dim $labels_no = UBound($labels_text) Dim $labels[$labels_no] Dim $labels_value[$labels_no] ; Find the max length of the longest label $label_len = 0 For $text In $labels_text $len = StringLen($text) If $len > $label_len Then $label_len = $len EndIf Next $label_len *= 6 ; GUI GUICreate('Joystick Test', 200, 200) GUICtrlCreateLabel('Joystick', 40, 20, 100, 20) For $i = 0 To $labels_no - 1 GUICtrlCreateLabel($labels_text[$i]&':', 10, 60 + $i * 12, $label_len, 12) $labels[$i] = GUICtrlCreateLabel('', 10 + $label_len, 60 + $i * 12, 70, 12) $labels_value[$i] = '' Next GUISetState() While 1 $coord = _GetJoy($Joystick, 0) For $i = 0 To UBound($coord) - 1 If $coord[$i] <> $labels_value[$i] Then GUICtrlSetData($labels[$i], $coord[$i]) $labels_value[$i] = $coord[$i] ;----------------------------------------------------- While $coord[7] Sleep(10) WEnd MsgBox(0, "Joy", "loose button", 1) ;---------------------------------------------------- EndIf Next Sleep(10) $msg =GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd $lpJoy=0 ; Joyclose ; _JoyInit() Func _JoyInit() Local $Joystick Global $JOYINFOEX_struct = "dword[13]" $Joystick=DllStructCreate($JOYINFOEX_struct) If @Error Then Return 0 DllStructSetData($Joystick, 1, DllStructGetSize($Joystick), 1);dwSize = sizeof(struct) DllStructSetData($Joystick, 1, 255, 2) ;dwFlags = GetAll Return $Joystick EndFunc ;====================================== ; _GetJoy($lpJoy,$iJoy) ; $lpJoy Return from _JoyInit() ; $iJoy Joystick # 0-15 ; Return Array containing X-Pos, Y-Pos, Z-Pos, R-Pos, U-Pos, V-Pos,POV ; Buttons down ; ; *POV This is a digital game pad, not analog joystick ; 65535 = Not pressed ; 0 = U ; 4500 = UR ; 9000 = R ; Goes around clockwise increasing 4500 for each position ;====================================== Func _GetJoy($lpJoy, $iJoy) Local $coor,$ret Dim $coor[8] DllCall("Winmm.dll","int","joyGetPosEx", "int",$iJoy, "ptr",DllStructGetPtr($lpJoy)) If NOT @Error Then $coor[0] = DllStructGetData($lpJoy,1,3) ; X Axis $coor[1] = DllStructGetData($lpJoy,1,4) ; Y Axis $coor[2] = DllStructGetData($lpJoy,1,5) ; Z Axis $coor[3] = DllStructGetData($lpJoy,1,6) ; R Axis $coor[4] = DllStructGetData($lpJoy,1,7) ; U Axis $coor[5] = DllStructGetData($lpJoy,1,8) ; V Axis $coor[6] = DllStructGetData($lpJoy,1,11); POV Value $coor[7] = DllStructGetData($lpJoy,1,9) ; Buttons Mask EndIf Return $coor EndFunc Edit: contrary to what you might think is not automation games, but a mechanical arm controlled by a joystick (analog) only by pressing the function assigned to it is called several times, even giving a touch very quickly on the button. I do not know if it violates the rules of the forum, anyway thanks.
  3. Hi all, I have a form with 15 textboxes. I need to set all of them disabled when i press a button. So i decided to use a loop. But how can i do it. Any idea ?
×
×
  • Create New...