-
Posts
334 -
Joined
-
Last visited
Everything posted by Myicq
-
I have been using the excellent CommMG for a long time. Always happy with performance. Today I have been using two different connections: one for a digital I/O board, and another for sending data. I time the communication using high precision "QueryPerformanceFrequency". I could not understand a difference between my settings and the measured timer. Using debugging I found that this code would take approx 70..100 msec - or about 35 msec each. ; --- select the I/O connection to trigger _CommSwitch(1) _CommSendstring("1") _CommSendstring("Q") ; --- select the data connection to send data _CommSwitch(4) _CommSendstring("XYZ") while without the _CommSwitch() the code block would take < 2 msec. I tried with the 64 bit version of CommMG as well. No difference. This may all be due to Windows functions being slow, and probably can't be improved ? Is there a way to avoid commswitch, such as using two instances of something - my experience is not enough to suggest what. In Delphi, I would have used two instances of a connection.
-
I have a small script that works using function keys (not related to gaming or keylogging). I set the keys using something like Opt ('GUIoneventmode', 1) HotKeySet("{F4}", "_functionF4") This is all good. But at times I wish to have my script open, and use other software on same machine. These other software may use function keys as well. Problem is that AutoIT has "captured" the function key, and thereby, the function key won't do anything in the other program. My question is: what is best approach to "not handle" the hotkeys when autoIT script is not focused ? And pass on keypress to the other software ? I could of course add a timer/ event to check for focus and set /unset hotkeys, but I think there should be a simpler way ?
-
Thing is though, I WANT to view any lines that are ConsoleWrite("debugtext" & @crlf) So it's only the 5-6 lines indicating the calling scripts and wrapper I want to suppress.
-
This may be a dumb question.. but my vertical screen space is fairly limited. I don't need (always) to see all the debug output from autoIT compiler, wrapper etc. Can I turn this part off: (optionally) >"D:\AutoIt3\SciTE\..\AutoIt3.exe" "D:\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\temp\xx.au3" +>11:35:44 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000406 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0406) +> SciTEDir => D:\AutoIt3\SciTE UserDir => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:D:\AutoIt3 input:D:\temp\XX.au3 +>11:35:44 AU3Check ended.rc:0 >Running:(3.3.12.0):D:\AutoIt3\autoit3.exe "D:\temp\xx.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
-
OO_JSON.UDF, JSON/path, OO, using javascript in Auto IT
Myicq replied to ozmike's topic in AutoIt Example Scripts
Made first steps with this one. Looks promising. But there are two things I could not figure, also not from examples. Given the following JSON structure: { "Name" : "Documentation", "Source" : ".", "Destination" : "..\\", "Pages" : { "abc" : "xxx" , "Configuration" : { "Here is my first key with a long name" : "test.md", "Another key with a strange name" : "this.md" }, "def" : "blah" } } I can get each part no problem. But as can be seen from "Configuration" the keys are not known, and may have long names. This leads me to two questions: 1) while iterating over "Pages", how can I know the type (differ "abc" = string from "Configuration" = object). I did try to use .type but always get "string" back. 2) while iterating over "Configuration", I get a lot of entries for the code below. I expected only two. And 2a) is there way to access configuration by index directly ? Here is what I tried so far: $oJSON = _OO_JSON_Init() $jsObj = $oJSON.parse(FileRead("docnet.json")) $keys = $jsObj.keys($jsObj.Pages) for $k in $keys if StringLen( $k) > 0 then ;- I get a lot of empty here so have to put in this test. Not sure why ? ConsoleWrite(">>>" & $k & " >>> " ) $t = $jsObj.Pages.type($k) ;- This always returns "string". ConsoleWrite("Type is ==> " & $t & @CRLF) ConsoleWrite($jsObj.Pages.item($k) & @CRLF) endif Next Thanks- 49 replies
-
- javascript
- json
-
(and 3 more)
Tagged with:
-
Is there any example code for large (touch screen friendly) check boxes ? I need to create a gui full-screen with about 16 different check boxes, approx 1x1 cm size. As this is not directly possible with Windows, I wonder if anyone has example code already ? My take would be to put Windings font in a label, and keep state behind the scenes in an sqlite database. Is this approach best way ?
-
Proper usage of sqlite commands?
Myicq replied to natwolf's topic in AutoIt General Help and Support
You don't specify your application, but if you have to enter a lot of data (as in 1000s or millions), you definately want to study on "transaction" syntax. This is part of SQL syntax, and not as such AutoIT related. But just a good practice. Otherwise, the database will be updated after every write, which is slowing your queries a lot after some number. I have started to us SQLite a lot with just the :memory: database, since it makes data structure handling trivial in some cases, where the alternative would be arrays. Especially where you need to select / update / delete the data. Just my 2c. Corrections welcomed if I am wrong! -
guiregistermsg delay (non-block) ?
Myicq replied to Myicq's topic in AutoIt General Help and Support
Here is the script so far. I have not been able to make the delay work, because the WM_MESSAGE only fires after keypress. So if I press two keys fast, and nothing else, it does not search until next keypress. Desired is to fire after last keypress+500 msec. Feedback is welcomed. Purpose of this script is to allow client to select a template. I want to display ONLY the name, but have other properties returned when selected. Search function is realtively fast already, but just for good measure, I would like to learn about the delay. and, if I could have done the same without SQLite, I would be happy to learn ! listbox-example.zip -
guiregistermsg delay (non-block) ?
Myicq replied to Myicq's topic in AutoIt General Help and Support
@AutoBert: I think this is pretty much along my thinking as well. I will try to pull something together, and post here. -
I am experimenting with a small gui where operator can filter results in a listbox based on another input box (source follows later). And then by selecting "NAME" column get other columns returned. I will use SQLite in the background to store actual data, and Excel as original source of data. It pretty much works. My only question is: can I delay a GuiRegisterMsg event, so that, schematically: * key event registers * has n msec passed since last keypress ? * if yes, then filter results. Else reset time counter. Reason is I don't want to delay gui too much if user is typing fast. I would prefer if this could be done in a non-blocking way, so no sleep() command. I am not using guionevent mode. Thanks for any help!
-
Hello Chimp, No, it is obviously 12 columns, but 4 datasets instead of 2. Think "sheets of labels", where each line is a sheet. Sometimes you have less, other times more labels. Each label has 1, maybe 4, maybe 3 fields. Your change correctly puts the number of fields on each line, but invalidates the datasets. I have updated the script so that the correct number of blank fields are added.
-
Just a small example, hope it will be useful to someone. (and not too trivial / simple) If the method can be improved, I would be happy to learn about it. Task : take a csv file with data, possibly organized in sets. Each line contains 1..n sets of data. Think 1 line of is a paper of labels. Each paper may have 1.. n labels where each label is 1 or more fields. Transform this to different column count of data set. Purpose is to transform customer data into different applications where different organization of data is needed. Source can of course be 1 column only. Example If this is transformed into 4 columns, result should be The code: Is this example script too simple to be allowed here ?
-
2D array problem (repeat index, wrap-around)
Myicq replied to Myicq's topic in AutoIt General Help and Support
@Melba23 of course, and I understand. Will try to detail here, sorry if being too verbose. Application is to create datafile for a print application (think endless webs, ticket printers, newspapers etc). This print application prints tickets / papers etc with numbers. Typically the paper is cut into smaller rolls, each roll then containing numbers from X-Y. So, the press must print f.ex 1..5900 1..5900 or reversed. The catch here is that the particular printing machine prints a certain width every print. Each "width" can contain from 1 to, say, 10 ticket. That is why the datafile must have several numbers in each line. Further, the print application may have several lanes, which each may use a different numbering series. I calculate the no. of tickets per print based on this width and ticket size. So, in the printout, a very simple numbering series could be (prints separated by bar) 1 2 3 | 4 5 6 | 7 8 9 | 1 2 3 | 4 5 6 | 7 8 9 | ... ^ restart of DB That adds up. But if it does not add up, the database file must be (I can't see other solution) added to until it matches a complete width, otherwise there will be holes in the print. The fields are statically linked, and the length of a print is constant. 1 2 3 | 4 5 6 | 7 8 9 | 10 | ^can't end here, or there would be unwanted blanks. The length of the finished database is not going to be infinite, typically number series are less than 10.000, and the maximum no. of repeats is never more than no. of tickets per print * amount of numbers. So for 3 tickets, and 3000 numbers, maximum 9000. Often less though. With 4 and 18 numbers, criteria is fulfilled after 9 lines, not 36. Below a screenshot of a typical print, this one has counting right-to-left (position of objects is indefferent and handled). Each print like this is one record. This example has 6 identical lanes, but could be different. I understand this is very specific, and I have already recieved some good input and ideas. I think I have an idea of the solution. Once complete, this part makes AU3 a very critical part of an every day application helping millions of labels and tickets have numbers. -
2D array problem (repeat index, wrap-around)
Myicq replied to Myicq's topic in AutoIt General Help and Support
Forgot to add (and can't edit): Reason to loop around: Image you print the lines from this array on a continous paper running right-to-left. If you reach the end of the array, you restart. The numbers must now be an ever-continous string of 1,2,3 | ,4,5,6 | ,7,8,9 | ,10,1,2 | ,3,4,5 | ,6,7,8 | ,9,10,.... The can't be lines with only 2 or 1 digit. The bars should clarify. -
2D array problem (repeat index, wrap-around)
Myicq replied to Myicq's topic in AutoIt General Help and Support
Thanks all for your answers ! Especially because it was more a puzzle / algorithm question, more than autoit stuff. I have learned from the examples, but maybe I did not explain well enough that the 2D initial array can be of different size. I will try to give another example and what I think could provide correct solution. 1) take a number of 1D arrays (or a single 2D array). This could be as simple as 1,2,3,4,5,6,7,8,9,10 2) now print this array so that it matches with example 3 columns. (10 placed in column 3). This is not always possible, but will at _maximum_ take 3 * 10 (lines * elements) lines. Now, if I had a second 1d array, I would also have to use 10 lines (same length). Hopefully it's clear now what I mean by "looping around." My proposed solution now. (for 2d arrays) The solution I am going to program soon will be: 1) treat the 2D array like 1D arrays, and create separately results as above. That part is simple. 2) now I have as many 2D arrays as I had lines in the original 2D array. 3) now I can take rows 1 and concatenate, rows 2 and concatenate etc. For final result . Example: Not sure if this is the fasted way, but it's the only one I can overview right now. -
2D array problem (repeat index, wrap-around)
Myicq posted a topic in AutoIt General Help and Support
I have a little stepstone in a project I just can't seem to get my head around. So, after 5-10 hours of hair-pulling, I throw the towell and call for help here. The first to provide a solution will be duly credited in the software I create This goes into a printing house. Task: i have a series of numbers in a 2D array. Typically defined by length of series, start, step etc. The generation is no problem. I need to write these to a file. This is where I have problems. An example illustrates: Number series. This is held in a 2D array 1,2,3,4,5,6,7,8,9 11,12,13,14,15,16,17,18,19 21,22,23,24,25,26,27,28,29 Now, I define a value "numbers per line". This is a value less than how many numbers I have on each line. Example 3 Futher I can define a start index value, example 5. Now I would like to take values of index 5,6,7 from line 1, 5,6,7 from line 2, 5,6,7 from line 3. And after that 8,9,1 from line 1 etc. The index wraps around if I reach the end. This continues until index 4 is at position 3. The part about how many lines to do is easy. What I can't figure out is how to "reset" the index value so that I cound 4,5,6,4,5,6,4,5,6,7,8,9,7,89,7,8,9,1,2,3,1,2,3 etc. Desired output here from example 5,6,7,15,16,17,25,26,27 8,9,1,18,19,11,28,29,21 2,3,4,12,13,14,22,23,24 Any suggestions open, take it as a challenge. What I have so far: I can' t figure out the repeating of the index, but I can do the wrap-around (checking the ubound). So, I get index 1,2,3,4,5,6,7,8,9,1,2,3.. which is of course wrong. (actual production number series is much more, just simple example here). -
Reading excel without office (compiled script)
Myicq replied to Myicq's topic in AutoIt General Help and Support
@water Thank you for suggestion on ADO. I think I will go with that. Essentially it's me being too lazy to build a GUI to input structured information. I need to store some global parameters and along with that an array 1..n of information. Think a little along lines of a graphical layout: you have paper size, margins, resolution etc as parameters, and 1..n objects with content, rotation, font, and many other parameters. Developing a usable gui for all that + data storage is not simple (for me ), so that's reason behind excel format. In excel, it's trivial to format a few cells, protect a few others, add healines, and pretty much done. -
a long time ago, when I was doing some coding in Access VBA, I needed to access some settings in a simple way. Essentially a bit like your setup where you have an array and key, and need to get info. In your place, I would look at SQLite functions, and develop a few wrapper functions to read and store info. Then forget about how data is stored, you would simple be able to do ; read value $myAmount=_get("pendingDivPayments","DCK") ; set value _set("pendingDivPayments","DCK", "500") There are also projects around here to deal with associative arrays, personally I like the SQLite approach better. Just some random ideas.
-
This question may be trivial: I am working on an application where customers can define parameters etc in Excel files (also). But the definition may be done in an office environment, whereas the definition file may be used in production, where Excel may not be available. So, in a compiled script (including excel.au3), can I read excel XLSX files (read-only is OK), or do I need certain components like ADO, or.. am I out of luck ? I can imagine others have been in similar situations, so would like to know the practicalities of the problem. If impossible, I will have to come up with something else / workaround.
-
Yes, I realize that is an option I can always use But since that specific keyboard offers very little styling and configuration options I am looking at other options before. Btw, there is also "tabtip.exe" available on Windows. That too can't really be styled. Maybe my fav OSK is just too old for a Win7 machine these days.. so, so far out look for other alternatives.
-
All, I have developed a good app for touch screen controllers. But I would like to save myself the time to develop an on-screen-keyboard. The touch controller does come with the built-in-Windows keyboard, but I think it's too bulky and can't be resized. I have tried the free keyboard "Click-N-Type", which is now a little outdated. I can open the keyboard, move it as desired and close it again. Problem is when I type something! I would like to open the keyboard just below the inputbox automatically. However when I type first character, I get focus on my form, and my form will cover the keyboard. Maybe I am missing something here.. is there any example code on how to work in code with on-screen-keyboards ? (other thank kdb.exe from Microsoft). This is what I have so far: Any kind of help appreciated.
-
Simple web downloader with progress bar
Myicq replied to colombeen's topic in AutoIt Example Scripts
@colembeen .. I would not worry about not getting feedback. There is too much "if likes < n then failure = 1" culture around. I am quite sure that there are many who used all / parts of your script, and did not find time / need / whatever to write a thank you. I guess I could find a good use of you script at some point, so from here also a wave of the flag, hurray and THANK YOU. But don't give up. Remember there are LOTS of scripts being posted here every day. Getting lots of feedback is like getting 1 million YT views. Does not mean what you did is bad though. -
I am currently doing a project involving keeping some parameters in an internal 2d array. I am reading part of that to and from an ini file. As part of the reading I need to put the variables from the ini file into the 2D array. I have found _arrayinsert(), but that creates additional lines. Bascially I would like something as this: Original array: [1] a1 a2 a3 a4 [2] b1 b2 b3 b4 [3] c1 c2 c3 c4And reading setting for "2" being d1 d2 d3 d4 I should now have [1] a1 a2 a3 a4 [2] d1 d2 d3 d4 [3] c1 c2 c3 c4Is there a built-in UDF or similar to do something like that already ? Or did I missing something real obvious ? I have rolled my own code, which works. But of course it could be improved. Thanks for all comments, happy to learn from you all !
-
Not sure if this belongs here, or in chat.. anyway, will have a go at it. I have started creating my first serious UDF, quite specific so just for me now. Question is: how do you guys (that made several UDFs) practically approach the creation of UDF ? I know about the UDF header function, and use it. That is fine. I am more thinking creation of initial function list, automatically creating call tips files etc etc that goes with it. Is there a "UDF for UDFs" ? Or do you just manually create first function, then UDF header, then summary of header at start of file ? Sorry if this is a bit messed, I am threading first baby steps into UDFs Will be happy to share once I have it close to completion, although probably really narrow audience.
-
XP and earlier systems may be what they are, with flaws and insecurity etc etc. Some still like them, and why not. I know of industrial systems in my business area that run off Win 3.1, booting from a flash card. What really puzzles me is how Microsoft (and others) feel the need to completely purge the net from documentation. Storage is cheap, so why not have a section dedicated "legacy documentation", containing APIs etc. I know they are eager to have people upgrade, but that does not justify removing apis as I see it. archive.org anyone ?
- 42 replies
-
- MSDN
- Minimum supported client
-
(and 1 more)
Tagged with: