cloq Posted February 16, 2010 Share Posted February 16, 2010 Hello,I am quite the newbie with arrays and stringsplits. I have copied and played with random bits of code from various authors and scripters here on this forum (Thank you!).I am trying out a script that reads titles from a csv file (book.csv), populates a combobox with titles, and when a title is selected (by choosing and clicking ok) the user will get basic info about publisher name, title, and pages. I am trying to put a variable to (one for each), publisher, title and pages. So when the user clicks ok, based on the title picked, msgbox = var1 + var2 + var3.Any help would be appreciated. Here is my current progress:Pub, Title, Pages Harper, Title01, 111 Coby, Title02, 222 Tor, Title03, 333 Random, Title04, 444expandcollapse popup#include <GUIConstants.au3> #include <File.au3> Global $in_filename $in_filename = "book.csv" Dim $lines,$Display, $NumCols _FileReadToArray($in_filename, $lines) $Columns = StringSplit($lines, ",") $NumCols=$Columns Dim $array[ $lines ][ $Columns ] For $i = 1 To $lines $Columns = StringSplit($lines[$i], ",") If $Columns = 1 Then Continueloop For $j = 1 To $Columns $array[$i-1][$j-1] = $Columns[$j] Next Next $Rows=$Lines-1 Global $ColumnA, $AllColumnA $M = 1 While $M <= $Rows -1 $ColumnA=$Array[$m] & "|" $M = $M + 1 $AllColumnA=$AllColumnA & $ColumnA Wend _Content() Func _Content() Global $menu1, $n1, $n2, $msg, $menustate, $menutext Global $Brand GUICreate("Test",400,200,-1,-1) $n1 = GUICtrlCreateCombo("", 10,10,100) GUICtrlSetData(-1,$AllColumnA) $n2 = GUICtrlCreateButton("Read", 10, 110, 50) GUICtrlSetState(-1, $GUI_FOCUS) GUISetState () Do $msg = GUIGetMsg() Select Case $msg = $n2 $Brand = GUICtrlRead($n1) MsgBox(0, "BookInfo", $Brand) EndSelect Until $msg = $GUI_EVENT_CLOSE Exit EndFunc Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now