Jump to content

array add column


Recommended Posts

hi is there anyway to insert a column, aside from _ArrayColInsert??

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListBox.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=c:\users\user\desktop\script\stringsplit1.kxf
$Form1_1 = GUICreate("Form1", 219, 98, 192, 114)
$Input1 = GUICtrlCreateInput("", 24, 16, 169, 21)
$Split = GUICtrlCreateButton("Split", 64, 48, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Split
            $read = GUICtrlRead($Input1)
            If $read = "" Then
                MsgBox(16, "Blank Input", "Blank")
            Else
                $STRIP = StringStripWS($read, $STR_STRIPALL)
                $split_ = StringSplit($STRIP, ",")

                For $i = 1 To UBound($split_) - 1
                    ConsoleWrite($split_[$i] & @CRLF)
                Next

                _ArrayDisplay($split_)
            EndIf
    EndSwitch
WEnd

 

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

You could try Redim

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListBox.au3>
#include <Array.au3>
Local $aResult[1][1]
#Region ### START Koda GUI section ### Form=c:\users\user\desktop\script\stringsplit1.kxf
$Form1_1 = GUICreate("Form1", 219, 98, 192, 114)
$Input1 = GUICtrlCreateInput("", 24, 16, 169, 21)
$Split = GUICtrlCreateButton("Split", 64, 48, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Split
            $read = GUICtrlRead($Input1)
            If $read = "" Then
                MsgBox(16, "Blank Input", "Blank")
            Else
                $STRIP = StringStripWS($read, $STR_STRIPALL)
                _StringToArray(StringSplit($STRIP, ","))
                _ArrayDisplay($aResult)
            EndIf
    EndSwitch
WEnd

Func _StringToArray($aSplit)
    If $aSplit[0] = 1 Then _ArrayAdd($aResult, $aSplit[1])
    If UBound($aResult, 2) < $aSplit[0] Then
        ReDim $aResult[UBound($aResult)][$aSplit[0]]
        _ArrayAdd($aResult, _ArrayToString($aSplit, "|", 1))
    EndIf
    $aResult[0][0] = UBound($aResult) - 1
EndFunc

 

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...