Search found 47 matches

by Peabianjay
20 May 2016, 09:07
Forum: Ask For Help
Topic: Object Key Sort Disable
Replies: 3
Views: 974

Re: Object Key Sort Disable

Very nice. Thank you.
by Peabianjay
17 May 2016, 19:47
Forum: Ask For Help
Topic: Object Key Sort Disable
Replies: 3
Views: 974

Object Key Sort Disable

The keys in an object are automatically sorted, which (no doubt) is helpful in many situations. I'm sure it speeds up referencing, but sometimes I'd like them to stay in the defined order. It's not hard to write a work-around, as shown here, but I don't care for the added code & maintenance necessar...
by Peabianjay
07 Feb 2016, 22:41
Forum: Wish List
Topic: Array Variables in GUI's
Replies: 13
Views: 5509

Re: Array Variables in GUI's

If I understand correctly: I can use an object. I can even change objects (by use of Gui, -Object). Or choose to not use objects (i.e. "the old way") But, I can't do both (according the documentation, -Object needs to be followed by +Object) That is, if I want to use you +Object with ONE control, th...
by Peabianjay
07 Feb 2016, 22:04
Forum: Ask For Help
Topic: Need guidance how to pattern match within a large amount of text.
Replies: 10
Views: 2340

Re: Need guidance how to pattern match within a large amount of text.

After reviewing RegExMatch myself, I figured this out....but still think "InStr" is better in this case. (The documentation also says it's faster for simple matches.) But, I'll share what I figured out.... <a href[^>]+> ; this grabs (or rather ignores) the whole HTML call from "<" to ">" <a href ; l...
by Peabianjay
07 Feb 2016, 21:37
Forum: Ask For Help
Topic: Need guidance how to pattern match within a large amount of text.
Replies: 10
Views: 2340

Re: Need guidance how to pattern match within a large amount of text.

Personally, I'd use https://autohotkey.com/docs/commands/InStr.htm . It would require a couple of calls, but easier to follow. Haystack = ( <td align="left" valign="top" class="bdr-rt Arl c777 fs11 pdgTop navigation bdrBtm"> <a href="http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=38000000000">...
by Peabianjay
07 Feb 2016, 13:28
Forum: Wish List
Topic: Array Variables in GUI's
Replies: 13
Views: 5509

Re: Array Variables in GUI's

@HotKeyit Very cool. Well, cool-ish. It is gonna be a pain redoing all my work around code. I've just started looking at it, but anticipate difficulties with global variables that are NOT part of the object. Still, MUCH MUCH better than pages of "global var1, var2, var3...." followed by copy in & co...
by Peabianjay
19 Dec 2015, 14:41
Forum: Ask For Help
Topic: Memory Use
Replies: 0
Views: 682

Memory Use

I wanted to look at my memory use, so I found a few example functions & such that people seem to think are great.....'cept, they're not working for me. They all report zero memory, for any/all processes. Primarily, I'm interested in the amount of memory in use by the script I'm working on. This one,...
by Peabianjay
13 Dec 2015, 10:29
Forum: Ask For Help
Topic: if var is [not] type
Replies: 2
Views: 946

Re: if var is [not] type

Thanks for the explanation. if (var + 1 . is . number) That's exactly where I got confused. Between the unquoted text treated as text, and undeclared variables still being treated as variables, I get befuddled. In general, if there is doubt, the appropriate place to post is Ask for Help. I have move...
by Peabianjay
11 Dec 2015, 20:53
Forum: Ask For Help
Topic: if var is [not] type
Replies: 2
Views: 946

if var is [not] type

Not sure if this quite qualifies as a bug, but the behavior is odd... If "var" is NOT a variable, but an expression: if var is number Has unpredictable(ish) results. var := 1 q := [ "Fish", "Dog", "Cow" ] if var is number msgbox, Yup, it's a number if var + 1 is number msgbox, Well, no, it's not act...
by Peabianjay
07 Dec 2015, 10:35
Forum: Ask For Help
Topic: Using a listvars hotkey to view local variables
Replies: 2
Views: 1011

Re: Using a listvars hotkey to view local variables

Meh. Ya, that works, 'cept then I'd have to know where the problems are before I know where the problems are. I suppose a hotkey to set a global flag, then if (DEBUG) { listvars } in every questionable place. Even doing that in every function is a lot, let alone everywhere. If only I didn't make mis...
by Peabianjay
06 Dec 2015, 13:17
Forum: Ask For Help
Topic: Using a listvars hotkey to view local variables
Replies: 2
Views: 1011

Using a listvars hotkey to view local variables

Listvars seems somewhat unpredictable. In this sample script, it's rare for listvars to report the local variables, despite the program being in the function "permanently". With multiple attempts & refreshes, once in a while, it'll show the local variables, but mostly not. Is there any way to make i...
by Peabianjay
06 Dec 2015, 13:05
Forum: Ask For Help
Topic: Random value from array (time related)
Replies: 4
Views: 2736

Re: Random value from array (time related)

Well, you said you were looking for a "random position from the array". The AHK command is https://autohotkey.com/docs/commands/Random.htm I wrote a small function called " random( x, y) " that uses that command to generate a random number. This: array1.maxindex() tells me how many values in the arr...
by Peabianjay
06 Dec 2015, 12:45
Forum: Ask For Help
Topic: cycling between keys Topic is solved
Replies: 12
Views: 2113

Re: cycling between keys Topic is solved

Alternatively:

Code: Select all

$1::
    send, % mod(counter++, 10 )
return
by Peabianjay
06 Dec 2015, 12:18
Forum: Ask For Help
Topic: Random value from array (time related)
Replies: 4
Views: 2736

Re: Random value from array (time related)

Not entirely sure I know what you're asking, but maybe something like this?

Code: Select all

Array1 := Array("Alpha", "Beta", "Gamma", "Delta", "Omega")

loop, 5
{
    msgbox, % Array1[random(1, array1.maxindex() )]
}
exitapp

random( x, y )
{
   Random, var, %x%, %y%
   return var
}
by Peabianjay
06 Dec 2015, 12:08
Forum: Ask For Help
Topic: Output command question Topic is solved
Replies: 2
Views: 993

Re: Output command question Topic is solved

You can also use, Send, % x Note the space after "%" which makes everything following it "evaluated" instead of "as is". Particularly helpful for arrays. These two msgbox's have the same result: x := "Blue" y := "Yellow" Msgbox, %x% is my colour. %y% is another colour. Msgbox, % x " is my colour. " ...
by Peabianjay
26 Nov 2015, 06:11
Forum: Wish List
Topic: Guicontrol, Radio
Replies: 0
Views: 1337

Guicontrol, Radio

It'd be nice if, for single-variable radio controls, to set the 5th button of a radio control: Instead of (or in addition to): "To check a new button within a radio group that only has one variable, specify for ControlID the name/text of the button if it is not the button with which the variable is ...
by Peabianjay
23 Nov 2015, 20:53
Forum: Wish List
Topic: Array Variables in GUI's
Replies: 13
Views: 5509

Re: Array Variables in GUI's

Understood. I just don't like it the way it is. "....[item.count] is an expression which returns a value from an array..." An important distinction. (I thought it was a direct reference to the value.) contrasted with "[fakeit_%A_Index%] which is simply a variable name." To be clear, my "Wish" wasn't...
by Peabianjay
23 Nov 2015, 18:14
Forum: Wish List
Topic: Array Variables in GUI's
Replies: 13
Views: 5509

Array Variables in GUI's

I'd like to be able to: gui,Add, Edit, vitem.count, % item.count Ya, I know it can be done with pseudo-arrays. Pretty sure it can't be with actual arrays. If it can, perhaps it should be documented? Currently, I work around it by copying an array into a pseudo-array, then back again after: for each,...
by Peabianjay
21 Nov 2015, 04:14
Forum: Ask For Help
Topic: Parameters and Variables
Replies: 2
Views: 891

Re: Parameters and Variables

Is this what you want?

Code: Select all

variablename := "x"
%variablename% := 5

test( variablename, x )

test( a, b )
{
    msgbox, % a " has the value " b
}
by Peabianjay
20 Nov 2015, 17:41
Forum: Scripts and Functions
Topic: Colourful Scrolling Text Window
Replies: 0
Views: 1050

Colourful Scrolling Text Window

Four small functions to create & manage a simple scrolling text log with colours. AHK_ID := text_log( x, y, w, h [, windowtitle ] ) Creates always-on-top window at x,y,w,h with title windowtitle . Returns AHK_ID of window created. error := write( text [, fontcolour, linenumber, backgroundcolour ] ) ...

Go to advanced search