Sign in to follow this  
Followers 0
ahmet

Array

3 posts in this topic




Maybe....

#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.3.4.0
    Author:         myName
    
    Script Function:
    Template AutoIt script.
    
#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <array.au3> ; for display only

$sides = Number(InputBox("Polygon", "Enter number of sites"))
Global $all[$sides + 1][2]
Global $input[$sides + 1][3]
Global $read_input[$sides + 1][3]
GUICreate("Polygon", (20 * $sides) + 121, (26 * $sides) + 77)
$ok_button = GUICtrlCreateButton("OK", 20 * $sides + 80, 26 * $sides + 50, 40, 20)
$ok_display = GUICtrlCreateButton("Display", 5 * $sides + 80, 26 * $sides + 50, 60, 20)
GUICtrlCreateLabel("x(i)", 15, 10)
GUICtrlCreateLabel("y(i)", 60, 10)
For $i = 1 To $sides
    $input[$i][1] = GUICtrlCreateInput("", 15, 30 * $i, 30, 20)
    $input[$i][2] = GUICtrlCreateInput("", 50, 30 * $i, 30, 20)
Next

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $ok_button
            Read_Input()
        Case $msg = $ok_display
            Read_Input(1)
    EndSelect
WEnd


Func Read_Input($display = 0)

    For $x = 1 To $sides
        $read_input[$x][1] = GUICtrlRead($input[$x][1])
        $read_input[$x][2] = GUICtrlRead($input[$x][2])
    Next
    If $display = 1 Then _ArrayDisplay($read_input)
EndFunc   ;==>Read_Input

*** tested ok

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I modifided it a bit and it works.

Share this post


Link to post
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
Sign in to follow this  
Followers 0