Jump to content

Search the Community

Showing results for tags 'wrap around'.

  • 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

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. If I wanna be able to "vertically rotate" (scroll up and down) 2D array rows, like... row 0 row 1 row 2 to row 2 row 0 row 1 etc. (both directions, where the one that disappears goes to the other end) ... 1) Do I have to make my own function, or is there a simple trick I am missing? 2) If I have to make my own function, would it be more or less like this one I made up? Problem here is that only "UP" is working... * I may be missing something very simple...? :-) * Why can't I seem to get the first row with _ArrayExtract($_aArray, 0, 0) somehow anyway...? #include <Array.au3> HotKeySet("{PGUP}", "_ArrayUp") HotKeySet("{PGDN}", "_ArrayDown") Global $aArray[3][2] = [["0 ", " car"],["1 ", " bike"],["2 ", " boat"]] ToolTip(_ArrayToString($aArray), 0,0) While 1 Sleep(100) WEnd Func _2D_ArrayScroll_vert ( $_aArray, $direction = 0 ) Local $aSplit_1, $aSplit_2 If $direction = 0 Then ; scroll DOWN ; get all rows except last $aSplit_1 = _ArrayExtract($_aArray, 0, UBound($_aArray) - 2 ) ;~ MsgBox(0,"", _ArrayToString($aSplit_1)) ; get last row only $aSplit_2 = _ArrayExtract($_aArray, UBound($_aArray) - 1, UBound($_aArray) - 1 ) ;~ MsgBox(0,"", _ArrayToString($aSplit_2)) ; $aSplit_2 = 'last row' + 'all rows except last' _ArrayAdd($aSplit_2, $aSplit_1) $_aArray = $aSplit_2 Else ; scroll UP $aSplit_1 = _ArrayExtract($_aArray, 1, UBound($_aArray) - 1 ) MsgBox(0,"", _ArrayToString($aSplit_1)) ; PROBLEM AREA: how to get 1st row of $_aArray into $aSplit_2 ? ;~ $aSplit_2 = $_aArray[0][2] ; doesn't work [1][2] neither $aSplit_2 = _ArrayExtract($_aArray, 0, 0) ; doesn't work, other variations get the wrong row, or too many rows MsgBox(0,"", _ArrayToString($aSplit_2)) _ArrayAdd ($aSplit_1, $aSplit_2) $_aArray = $aSplit_1 EndIf $aArray = $_aArray ToolTip(_ArrayToString($aArray), 0,0) EndFunc Func _ArrayDown() _2D_ArrayScroll_vert ( $aArray ) EndFunc Func _ArrayUp() _2D_ArrayScroll_vert ( $aArray, -1 ) EndFunc #cs ; DOWN 0 car 1 bike 2 boat 2 boat 0 car 1 bike ; UP 0 car 1 bike 2 boat 1 bike 2 boat 0 car #ce Thanks!
×
×
  • Create New...