
Joec49
Active Members-
Posts
22 -
Joined
-
Last visited
Joec49's Achievements

Seeker (1/7)
0
Reputation
-
How does one write to disk using sqlite - I tried and it did nothing....help!
-
#include <GuiConstants.au3> ; Hides tray icon #NoTrayIcon ; enables events Opt("GUIOnEventMode", 1) ;builds the gui $hmain=GUICreate("Stocks",150, 200) ;1st number is width, 2nd is height GUISetOnEvent($GUI_EVENT_CLOSE, 'myExit') GUICtrlCreateLabel("Stock Quote",50,10,-1,-1,-1) GUICtrlSetColor(-1,0x0000FF) ;makes color of the above blue $theStock=GUICtrlCreateInput("",20,40,100,20); ;left, top, width, height GUICtrlCreateButton("Process", 20, 100, 50, 20) GUICtrlSetOnEvent(-1, 'process') ; Runs process() when pressed GuiCtrlCreateButton("About",90,100,50,20) GUICtrlSetOnEvent(-1,'About') GUICtrlCreateButton("Exit", 20,130,50,20) GUICtrlSetOnEvent(-1,'myExit') GuiCtrlCreateButton("HELP",90,130,50,20) GuiCtrlSetOnEvent(-1,'help') GUISetState(@SW_SHOW) ;--------------we now loop, waiting on events------------------------------------- While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then myExit() sleep(1000) ;************wait 1 seconds in each loop to keep cpu load low**************** WEnd GUIDelete() func myExit() exit EndFunc func About() msgbox(64,"ABOUT","Written by Joe Collins using AutoIt3, 3/9/2009") Return EndFunc func help() $l= "This pogram retrives stock quotes from finance.yahoo.com and" & @CRLF $l=$l&"displays it along with other market data. To get multiple quotes," & @CRLF $l=$l&"place a + between the ticker symbols." Msgbox(64,"HELP",$l) EndFunc func process() $symbol=GuiCtrlread($theStock) $symbol=StringRegExpReplace($symbol," ","") $mystr="http://quote.yahoo.com/d/quotes.csv?s=^DJI+^GSPC+^RUI+^RUT+^RUA+^DWC+^VIX+^TV.N+" & $symbol & "&f=d1t1sl1c1&e=csv"; InetGet($mystr, "\temp\results.txt", 1, 0) ;1=forced get of data, avoid cached results; 0=wait until done $str=FileRead("\temp\results.txt") $str=StringRegExpReplace($str,"""","") if(StringRegExp($str,"N/A")) Then msgbox(64,"ERROR","unknown symbol found: "& $symbol) GUICtrlSetData($theStock,"") return Else ;a set of regular expression to clean up the result $str=StringRegExpReplace($str,"\^GSPC","S\&P 500") $str=StringRegExpReplace($str,"\^DJI","DJIA") $str=StringRegExpReplace($str,"\^TV.N","NYSE VOLU") $str=StringRegExpReplace($str,",0.00","") $str=StringRegExpReplace($str,"\^VIX","Volatility Index") $str=StringregExpReplace($str,"\^RUI","Russell 1000") $str=StringregExpReplace($str,"\^RUT","Russell 2000") $str=StringregExpReplace($str,"\^RUA","Russell 3000") $str=StringRegExpReplace($str,"\^DWC","Wilshire 5000") $str=StringRegExpReplace($str,"\d{1,2}/\d{1,2}\/\d{4},","") ;remove date sloppily $str=StringRegExpreplace($str,"\d{1,2}:\d{2}(a|p)m,","") ;remove time sloppily ;now display it MsgBox(64,"MOST RECENT RESULTS",$str) endif EndFunc
-
That worked - I can compile again - I sent a complaint to avg about false positives with autoit.
-
I know about that so I shutdown my antivir s/w and reinstalled autoit but I still have the problem and still have the file it says is missing. Any other ideas? where does AutoItSC.bin need to be located (win/sytem32?, aut2exe die?) Joe
-
I get this every time I build (F7)-the missing file is in the auto2exe subdirectory - any ideas?
-
New SciTE4AutoIt3 available with SciTE v1.77
Joec49 replied to Jos's topic in AutoIt Technical Discussion
My antivirus s/w treats AutoitSC.bin as a trojan horse and deletes it.....I cannot compile etc....any tips? Joe -
How do I find which item/row selected in listview?
Joec49 replied to Joec49's topic in AutoIt GUI Help and Support
Thanks - works great! But how do I then get the selected text:func theview_select() $aItem1=_GUICtrlListView_GetSelectedIndices($listview,False); gives me what item# is selected if($aItem1 = "") Then msgBox(64,"ZIP","nothing selected") else ;gives me row/item# in 0-based origin $text=_GUICtrlListView_GetItemText($listview,$aItem1,-1) Msgbox(64,"viewselect aItem","Value:" & $aItem1 & ";" & $text) endif EndFunc The $text variable is always blank?? -
How do I see which item/row they selected when I process the button event? Relevant code stub is below: func theview_select() $aItem1=_GUICtrlListView_GetHotItem($listview) $aItem2 = _GUICtrlListView_GetItemTextArray($listview, -1) Msgbox(64,"viewselect aItem","Value:" & $aItem1 & "; " & $aItem2) EndFunc Func theview() ;button $child=GUICreate("Reminder Event Details", 500, 400); BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit3') GUICtrlCreateLabel("REMINDER: View Event",100,10,-1,-1) GUISetBkColor(0x88AABB) GUICtrlCreateButton("SELECT",400,50,50,20) GUICtrlSetOnEvent(-1,"theview_select") GUICtrlCreateButton("VIEW",400,100,50,20) GuiCtrlSetOnevent(-1,'theview_view') GUICtrlCreateButton("DELETE",400,150,50,20) GUICtrlSetOnEvent(-1,'theview_delete') GUICtrlCreateButton("HELP",400,250,50,20) GUICtrlSetOnEvent(-1,'theview_help') GUICtrlCreateButton("QUIT",400,200,50,20) GUICtrlSetOnEvent(-1,"guiexit3") $blanks=" " $listview =GUICtrlCreateListView("Seq#|Date|Time|Text" & $blanks, 10, 10, 350, 350) ;,$LVS_SORTDESCENDING) $rows=UBound($eventArray)-1 For $x = 0 To $rows ;we load upcoming data from our arrays ;$eventArray=(yyyymmddhhmm, text) (2 columns per row) $timed=$eventArray[$x][0] ;yyyymmddhhmm $textd=$eventArray[$x][1] ;text of reminder if(FALSE=StringRegExp("^|",$textd)) Then $ddate=StringLeft($timed,8) ;yymmdd $dtime=StringRight($timed,4) ;hhmm $ts=StringLeft($dtime,2) & ":" & StringRight($dtime,2) ; hhmm -> hh:mm GUICtrlCreateListViewItem($x & "|" & $ddate & "|"& $ts & "|" & $textd, $listview); EndIf Next ;GUICtrlSetResizing($listview, $GUI_DOCKALL) GUISetState(@SW_SHOW) EndFunc Thanks in advance Joe joec_49@hotmail.com
-
-
Here is more code and now QUIT works but the other buttons light when I move the mouse over them but do nothing when I click except when I click on QUIT, it calls guiexit3 and does the proper thing. But SELECT, VIEW, DELETE and HELP are coded properly (I think) but ignored completely- only QUIT works. Func guiexit3() ;TAKES DOWN CHILD AND THEN RETURNS GuiDelete($child) Return endfunc ;The theview button func theview_delete() Msgbox(64,"theviewDELETE","HI") EndFunc func theview_help() $s= "This window allows you to see all scheduled reminders and" $s=$s & @cr & "sorts them in date/time order. You can view any selected" $s=$s & @cr & "item and also delete any selected item." Msgbox(64,"theview HELP",$s) EndFunc func theview_view() MSGBOX(64,"theviewVIEW","THERE") EndFunc func theview_select() MSGBOX(64,"VIEWSELECT","HI") EndFunc Func theview() ;button $child=GUICreate("Reminder Event Details", 500, 400); GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit3') GUICtrlCreateLabel("REMINDER: View Event",100,10,-1,-1) GUISetBkColor(0x88AABB) GUICtrlCreateButton("SELECT",400,50,50,20) GUISetOnEvent(-1,"theview_select") GUICtrlCreateButton("VIEW",400,100,50,20) GuiSetOnevent(-1,'theview_view') GUICtrlCreateButton("DELETE",400,150,50,20) GUISetOnEvent(-1,'theview_delete') GUICtrlCreateButton("HELP",400,250,50,20) GUISetOnEvent(-1,'theview_help') GUICtrlCreateButton("QUIT",400,200,50,20) GUICtrlSetOnEvent(-1,"guiexit3") $listview =GUICtrlCreateListView("Seq#|Date|Time|Text", 10, 10, 350, 350) For $x = 1 To 100 GUICtrlCreateListViewItem($x & "|mm/dd/yyyy|hh:mm|randomtext", $listview); Next ;GUICtrlSetResizing($listview, $GUI_DOCKALL) GUISetState
-
Yes - what I showed was a small section of the overall code. The other windows (with buttons) work fine but this does not.I simply cannot figure out why.... Joe
-
I stripped it down further and still no luck Func anyname() $child=GUICreate("Details", 500, 400); GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit3') GUICtrlCreateButton("QUIT",200,100,100,100) GUISetOnEvent(-1,'guiexit3') GUISetState(@SW_SHOW) endfunc Here is the called function Func guiexit3() GuiDelete($child) Return endfunc The button appears fine but when I click on it, nothing happens. I have done this with other windows many times before and it works fine but not here...any ideas? =====================================================================
-
All button events defined....window comes up and buttons ignored...any ideas? $child = GUICreate("Event Details", 500, 400); GUISetOnEvent($GUI_EVENT_CLOSE, 'guiexit4') GUICtrlCreateLabel("View Event",100,10,-1,-1) GUISetBkColor(0x88AABB) GUICtrlCreateButton("SELECT",20,375,50,20) GUISetOnEvent(-1,'view_select') GUICtrlCreateButton("VIEW",400,100,50,20) GuiSetOnevent(-1,'view_view') GUICtrlCreateButton("DELETE",400,150,50,20) GUISetOnEvent(-1,'view_delete') GUICtrlCreateButton("HELP",400,200,50,20) GUISetOnEvent(-1,'view_help') GUICtrlCreateButton("QUIT",400,250,50,20) GUISetOnEvent(-1,'guiexit3') GUISetState(@SW_SHOW) ... Func guiexit3() GuiDelete($child) Return endfunc
-
I worked for years in PERL and Hashes are awesome in that language. I missed not having them here but perhaps this HASH TABLE UDF may solve it. Autoit should make it native in the language. It is a very powerful feature. In fact I wrote a program to help my wife and wrote it in perl using hashes. But she needs a cover function so it is windows-like and hence I wrote her that in Autoit. I used PERL mostly on windows platforms (MSDOS) and to some degree under UNIX. Perl is a great language for processing text and more. A hash for those who want to know it is an access method of sorts. You have a table in memory with the key to the table as your hash key and the data portion is mapped to that key. So it is stored as pairs (key,data) in the hash. The data can be text, binary, a pointer etc. The data is stored with its key randomly in the hash and the concept of sequentially reading it meaningless. But you can sort a hash by its keys or by its data. In Perl, the language is optimized for hashes and they are very very fast to work with.
-
I found an answer that works for me: While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then CLOSEClicked() sleep(2000) ;************wait 2 seconds in each loop to keep cpu load low**************** EventCheck() ;this is a new event, just for this program WEnd I inserted a 2 sec delay each loop and then check if time has arrived. It cuts the loops from 320,000 to about 75 or so. The GUI still responds as if no delay....this is not the preferred solution but it works.