Sign in to follow this  
Followers 0
marko001

How to assign value to a "dinamic" Input box

7 posts in this topic

Hi all,

given this function:

func _createInput()
    $Alto  = 150
    $Sinistra = 176
    $delta = 0
    $multiplier = 0
    global $a,$s,$t
    for $t = 1 to 20
        for $a = 1 to 14 Step 1
            Assign("s",$t & "_" & $a)
            assign($s,GUICtrlCreateInput("",$Sinistra   +$delta*$multiplier,    $Alto,50,21,$ES_READONLY))
            $delta = 55
            $multiplier = $multiplier+1
        Next
        $alto = $alto +25
        $delta = 0
        $multiplier = 0
    Next
EndFunc

_createInput()

It creates me in the form all the input boxes i need.

How can i now GUICTRLSETDATA to every input?

if the correct expression is guictrlsetdata(IDcontrol,data) where do I get the exact control id?

Thanks,

Marco

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Avoid using Assign and simply use an Array to hold the Inputcontrol handles which then makes it simple to read them or write to them.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Can you please make me an example? I'm a bit tard about it.

Thanks a lot, mate.

Marco

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Can you please make me an example? I'm a bit tard about it.

Thanks a lot, mate.

Marco

this code is filling the array... just use similar logic with the other GUI functions:

Dim $INputHND[21][15]

Func _createInput()
    $Alto = 150
    $Sinistra = 176
    $delta = 0
    $multiplier = 0
    Global $a, $s, $t
    For $t = 1 To 20
        For $a = 1 To 14
            $INputHND[$t][$a] = GUICtrlCreateInput("", $Sinistra + $delta * $multiplier, $Alto, 50, 21, $ES_READONLY)
            $delta = 55
            $multiplier = $multiplier + 1
        Next
        $Alto = $Alto + 25
        $delta = 0
        $multiplier = 0
    Next
EndFunc   ;==>_createInput

_createInput()
Edited by Jos
fixed code

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Func _createInput()
    $Alto = 150
    $Sinistra = 176
    $delta = 0
    $multiplier = 0
    Global $a, $s, $t
    For $t = 1 To 20
        For $a = 1 To 14
            $INputHND[$t][$a] = GUICtrlCreateInput("", $Sinistra + $delta * $multiplier, $Alto, 50, 21, $ES_READONLY)
            $delta = 55
            $multiplier = $multiplier + 1
        Next
        $Alto = $Alto + 25
        $delta = 0
        $multiplier = 0
    Next
EndFunc   ;==>_createInput

_createInput()

This is the correct one, you missed a [$a]

Thanks a lot, mate!

Share this post


Link to post
Share on other sites

@Jos - Nice example. That should be put in the Wiki cookbook.

I have used a "simpler" example in SciTEConfig.au3 in the Tab where you can set the Color settings. ;)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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