Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/08/2013 in all areas

  1. by the way I must say to myself RTFM that was in HelpFile but thanks for Your attention
    1 point
  2. MDCT, Consider this: Mr A orders stuff on 3/3/2103 Mr B orders stuff on 3/3/2013 Mr A orders additional stuff on 3/3/2013 Mr B orders more of the same stuff he ordered earlier 0n 3/3/2013 Mr A orders stuff on 3/4/2013 For an INI file to handle this each section ("order") needs to be unique. So what you are calling "[Day01]" really needs to be something like "[YYYMMDD-Name-SEQNO]", or, "[YYYYMMDDHHMMSS]". If you tried to do something like: [Day01] Order=Mr. X Brands=Lion,,Dog,Cat,Cow,,,Aligator Order=Mr. Y Brands=Lion,,,,,,,Aligator "Order" and "Brand" for Mr. Y would overlay the same values for Mr.X (keys must be unique). Speed of processing is not your major issue, you might want to give more thought to overall design. kylomas
    1 point
  3. MDCT, Have you considered an SQLite solution? kylomas edit: The following is an example of SQLite usage. It has nothing to do with your problem, it is simply an example of SQLite syntax, usage and speed, at a very simple level. ; *** Start added by AutoIt3Wrapper *** #include <GUIConstantsEx.au3> ; *** End added by AutoIt3Wrapper *** #include <sqlite.au3> #AutoIt3Wrapper_Add_Constants=n local $Parts_fl = @scriptdir & '\Parts.txt' local $Parts_DB = @scriptdir & '\Parts.DB3' ;-------------------------------------------------------------------------------------------------------- ; generate test file of 5,000 comma delimited items, 3 entries (cols) per line (row) if $refresh is true ;-------------------------------------------------------------------------------------------------------- local $refresh = true if $refresh then filedelete($Parts_fl) if not fileexists($Parts_fl) then local $hfl = fileopen($Parts_fl,2) if $hfl = -1 then ConsoleWrite('File open failed' & @LF) Exit endif local $str_out for $1 = 1 to 5000 $str_out &= stringformat('%05i,M%05s,V%05s\n',$1,$1 & '-' & random(1,999,1),$1 & '-' & random(1,999,1)) Next filewrite($hfl,$str_out) fileclose($hfl) $hfl = 0 endif ;--------------------------------------------------------------------------------------- ; initialize SQLite and open Parts DB ;--------------------------------------------------------------------------------------- local $sqlstrt = _SQLite_Startup(), $st = timerinit() if @error then ConsoleWrite('error loading sqlite.dll' & @LF) Exit EndIf local $hmemDB = _sqlite_open($Parts_DB) if @error then ConsoleWrite('Unable to open DB' & @LF) _Exit() EndIf if $refresh then _reload() func _reload() ; drop "parts" table if it exists, re-define and reload it if _sqlite_exec(-1,'drop table if exists parts;') <> $sqlite_ok then ConsoleWrite('Drop table failed' & @LF) _exit() Else ConsoleWrite('Parts table dropped for refresh' & @LF) endif if _sqlite_exec(-1,'create table parts (SKU, Model, Version);') <> $sqlite_ok then ConsoleWrite('Create Table Failed' & @LF) _exit() endif local $fl_array _filereadtoarray($Parts_fl,$fl_array) switch @error case 1 ConsoleWrite('Input file failed to open' & @LF) _exit() case 2 ConsoleWrite('Unable to split file' & @LF) _exit() EndSwitch local $aLine, $sql ProgressOn('Loading Parts Table','Please Wait') _SQLite_Exec(-1, "begin immediate;") for $1 = 1 to $fl_array[0] progressset(($1/$fl_array[0])*100) $aLine = stringsplit($fl_array[$1],',') $sql = 'insert into parts values (' for $2 = 1 to $aLine[0] $sql &= '"' & $aLine[$2] & '",' next $sql = stringtrimright($sql,1) $sql &= ');' if _sqlite_exec(-1,$sql) <> $sqlite_ok Then ConsoleWrite('Table insert failed STMT = ' & $sql & @LF) _exit() endif next _SQLite_Exec(-1, "commit;") progressoff() ConsoleWrite('Table loaded with ' & ubound($fl_array)- 1 & ' records in ' & round(timerdiff($st)/1000,3) & ' seconds' & @LF) endfunc ;--------------------------------------------------------------------------------------- ; display SKU query dialaog ;--------------------------------------------------------------------------------------- local $gui010 = guicreate('SKU Query Mini-APP Using SQLITE',300,170) local $aSize = wingetclientsize($gui010) guictrlcreatelabel('Enter SKU for Query',40,20,150,20) guictrlsetfont(-1,10,600) GUICtrlSetColor(-1,0xaa0000) local $inp010 = guictrlcreateinput('',190,20,40,20) local $lbl010 = guictrlcreatelabel('',70,60,250,50) guictrlsetfont(-1,10,600,-1,'Courier New') guictrlsetcolor(-1,0x000099) local $btn010 = guictrlcreatebutton('Submit Query',10,$aSize[1]-30,$aSize[0]-20,20) guictrlsetfont(-1,9,600) local $dmy010 = GUICtrlCreateDummy() guisetstate() local $aAccelKeys[1][2] = [["{ENTER}", $dmy010]] GUISetAccelerators($aAccelKeys) local $aRow, $ret while 1 switch guigetmsg() case $gui_event_close _exit() case $btn010, $dmy010 _disp() endswitch wend func _disp() $ret = _SQLite_QuerySingleRow(-1,'select SKU,Model,Version from parts where SKU = "' & stringformat('%05s',guictrlread($inp010)) & '";', $aRow) if $ret = $sqlite_ok then guictrlsetdata($lbl010,stringformat('%-10s%5s\n%-10s%5s\n%-10s%5s','SKU',$aRow[0],'Model',$aRow[1],'Version',$aRow[2])) Else guictrlsetdata($lbl010,guictrlread($inp010) & ' Not Found') endif guictrlsetstate($inp010,$gui_focus) endfunc func _exit() _SQLite_Close() _SQLite_Shutdown() exit endfunc
    1 point
  4. guinness

    How Efficient is AutoIT

    With all due respect you haven't provided any code so your results mean nothing.
    1 point
  5. Dana and others, I am looking to refine the UDF to meet user expectations. When you move the edit control around with the keys, what would you prefer to happen when you reach an edge? At the moment the editing process terminates - but it could quite easily be modified to remain on the last valid column/row. Or would you like this behaviour to be user-defined via a suitable parameter? M23 Edit: Or should the edit control move to the other end/side and loop? Any or all of those 3 options should be possible. Edit 2: It was really easy to add all 3 options plus the single edit to be user-defined using an existing parameter - so I have done just that.
    1 point
  6. guinness

    get ip

    Of course, this retrieves you public IP address when connected to the Internet.
    1 point
  7. $GUI_BKCOLOR_TRANSPARENT work #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 306, 231, 215, 165) GUISetBkColor(0x008080) $Label1 = GUICtrlCreateLabel("Label1", 64, 64, 164, 89) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Post your code, if you have one...
    1 point
  8. czardas

    Is AutoIT perfect?

    @ileandros Moderation. is an unrelated issue, and I disagree with you. Moderators should remove code that breaks forum rules. For that they need to be able to edit other people's posts.
    1 point
×
×
  • Create New...