MikelSevrel Posted February 25, 2006 Share Posted February 25, 2006 I'm trying to setup a selection at the beginning of a script based on a file. The string might have something like Monday,Friday in it. But I have trouble with this, here's what I have. Select Case StringInStr($inivar[8][1], "Sunday") $1 = 2 Case StringInStr($inivar[8][1], "Monday") $2 = 3 Case StringInStr($inivar[8][1], "Tuesday") $3 = 4 Case StringInStr($inivar[8][1], "Wednesday") $4 = 5 Case StringInStr($inivar[8][1], "Thursday") $5 = 6 Case StringInStr($inivar[8][1], "Friday") $6 = 7 Case StringInStr($inivar[8][1], "Saturday") $7 = 8 EndSelect $dates = _ArrayCreate ($1, $2, $3, $4, $5, $6, $7) For $i = 1 To $dates _GUICtrlListViewSetCheckState ($ListView, $i, 1) Next Coming soon.... Link to comment Share on other sites More sharing options...
nfwu Posted February 25, 2006 Share Posted February 25, 2006 I don't understand what's going on here. Can you explain what do you want to do? TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
GaryFrost Posted February 25, 2006 Share Posted February 25, 2006 (edited) expandcollapse popup#include <GUIConstants.au3> #include <GuiListView.au3> Global Const $Cursor_WAIT = 15 Global Const $Cursor_ARROW = 2 GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color $listview = GUICtrlCreateListView("day of the week", 10, 10, 200, 200);,$LVS_SORTDESCENDING) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT) GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_CHECKBOXES, $LVS_EX_CHECKBOXES) GUICtrlCreateListViewItem("Sunday", $listview) GUICtrlCreateListViewItem("Monday", $listview) GUICtrlCreateListViewItem("Tuesday", $listview) GUICtrlCreateListViewItem("Wednesday", $listview) GUICtrlCreateListViewItem("Thursday", $listview) GUICtrlCreateListViewItem("Friday", $listview) GUICtrlCreateListViewItem("Saturday", $listview) GUISetState() Dim $inivar[9][2] $inivar[8][1] = "Saturday" _SetDay($listview, $inivar[8][1]) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Func _SetDay(ByRef $lv_days, $t_input) Local $found_day = 0, $x GUISetCursor($Cursor_WAIT, 1) For $x = 0 To _GUICtrlListViewGetItemCount ($lv_days) - 1 If StringInStr(StringUpper(_GUICtrlListViewGetItemText ($lv_days, $x, 0)), StringUpper($t_input)) Then GUICtrlSetState($lv_days, $GUI_FOCUS) _GUICtrlListViewSetCheckState ($lv_days, $x) $found_day = 1 ExitLoop EndIf Next GUISetCursor($Cursor_ARROW, 1) If Not $found_day Then MsgBox(0, "No Match", "Day not found: " & $t_input) EndIf EndFunc ;==>_SetDay Edited February 25, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
MikelSevrel Posted February 25, 2006 Author Share Posted February 25, 2006 Sorry that I wasn't more specific. But, the answers lay within those posts. So thanks. Coming soon.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now