Jump to content

ToolTip an _ArrayDisplay..?


Recommended Posts

  • Moderators

would there be anyway to ToolTip an _ArrayDisplay..??

or display an Array in such a way that doesn't require a user interaction to close the window that's displaying the Array..??

Local $a_test[3] = ["Test1","Test2","Test3"]
_ArrayDisplay_Tooltip($a_test)
Sleep(3000)

Local $a_test2[3][2] = [["uTest1",1],["uTest2",2],["uTest3",3]]
_ArrayDisplay_Tooltip($a_test2)
Sleep(3000)

Func _ArrayDisplay_Tooltip($a_array, $s_title = "Array Tooltip Display", $i_x = Default, $i_y = Default)
    If UBound($a_array, 3) Then Return SetError(1, 0, 0); only 2D array for simplicity.
    Local $i_ub1 = UBound($a_array), $i_ub2 = UBound($a_array, 2), $s_tip = $s_title & @CRLF
    If $i_ub2 Then
        For $i = 0 To $i_ub1 - 1
            For $j = 0 To $i_ub2 - 1
                $s_tip &= "[" & $i & "][" & $j & "] = " & $a_array[$i][$j] & @CRLF
            Next
        Next
        Return ToolTip(StringTrimRight($s_tip, 2), $i_x, $i_y)
    EndIf
    For $i = 0 To $i_ub1 - 1
        $s_tip &= "[" & $i & "] = " & $a_array[$i] & @CRLF
    Next
    Return ToolTip(StringTrimRight($s_tip, 2), $i_x, $i_y)
EndFunc

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...