Search found 771 matches
- 23 Feb 2016, 07:01
- Forum: Ask for Help (v1)
- Topic: (solved) local=global warnings?
- Replies: 7
- Views: 2908
Re: local=global warnings?
The two demos below should show why you're getting the error: Working Example: Foo.Bar() MsgBox % Foo.__Class ; still works due to 'local' declaration in function class Foo { Bar() { local Foo := "Hello World" MsgBox %Foo% } } Erroneous Example: global Foo := "Hello" Fn() Fn() { ; triggers the error...
- 21 Feb 2016, 09:36
- Forum: Ask for Help (v1)
- Topic: Database
- Replies: 12
- Views: 6869
Re: Database
Here's the GitHub repo for ObjCSV.ahk. The repo contains multiple demo scripts that should help you get started with its usage. Here are the author's posts regarding ObjCSV:
- 20 Feb 2016, 04:23
- Forum: Ask for Help (v1)
- Topic: Nested class objects - Find parent object
- Replies: 3
- Views: 1893
Re: Nested class objects - Find parent object
Glad to help
- 20 Feb 2016, 03:54
- Forum: Ask for Help (v1)
- Topic: Nested class objects - Find parent object
- Replies: 3
- Views: 1893
Re: Nested class objects - Find parent object
I do this if I need a reference to the parent class while avoiding a circular reference: p := new Parent MsgBox % p.Child1.Parent == p class Parent { __New() { this.Child1 := new Parent.Child(this) } class Child { __New(self) { this.__Parent := &self } Parent[] { get { if (NumGet(this.__Parent) == N...
- 19 Feb 2016, 13:27
- Forum: Ask for Help (v1)
- Topic: [SOLVED] How to call a method using gui with or without creating an instance from it's class
- Replies: 7
- Views: 2085
Re: [SOLVED] How to call a method using gui with or without creating an instance from it's class
Here is the working code: Class MyClass { static MyAttr := "sometext" MyMethod() { MsgBox, % MyClass.MyAttr } } Gui, Add, Tab2,, First Tab|Second Tab|Third Tab ; Tab2 vs. Tab requires v1.0.47.05. Gui, Add, Checkbox, vMyCheckbox gMyClass.MyMethod, Sample checkbox Gui, Tab, 2 Gui, Add, Radio, vMyRadi...
- 19 Feb 2016, 12:57
- Forum: Ask for Help (v1)
- Topic: [solved] multiple class extensions
- Replies: 2
- Views: 1165
Re: multiple class extensions
class closeWindow extends element should be class closeWindow extends action
- 17 Feb 2016, 05:33
- Forum: Off-topic Discussion
- Topic: AutoHotkey style guide
- Replies: 13
- Views: 7448
Re: AutoHotkey style guide
; bad s := "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Totam, minima!`n" . "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eum, eaque.`n" . "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et, veniam." ; good s = ( Lorem ipsum dolor sit amet, consectetur adipisic...
- 10 Feb 2016, 20:51
- Forum: Ask for Help (v1)
- Topic: Efficient way to count appearances of specific character in a string
- Replies: 6
- Views: 2748
Re: Efficient way to count appearances of specific character in a string
If there's no requirement for a RegEx pattern, then StrReplace should suffice. In most cases, the difference in speed is negligible, however if you're going to call them recursively/repeatedly, StrReplace trumps RegExReplace: line := " ( fish|cheese|beer|fruit|fish|cheese|beer|fruit|fish|cheese|beer...
- 10 Feb 2016, 03:30
- Forum: Ask for Help (v1)
- Topic: (solved.. I should learn to read)what to use instead of the deprecated delete?
- Replies: 1
- Views: 492
- 09 Feb 2016, 19:55
- Forum: Ask for Help (v1)
- Topic: [SOLVED] How to call a method using gui with or without creating an instance from it's class
- Replies: 7
- Views: 2085
Re: How to call a method using gui with or without creating an instance from it's class
You need to use GuiControl to associate a function object, see: GuiControl(Functor)
Example:
Example:
Code: Select all
Gui, Add, Checkbox, vMyCheckbox, Sample checkbox
method := ObjBindMethod(MyClass, "MyMethod")
; or method := MyClass.MyMethod.Bind(MyClass)
GuiControl +g, MyCheckbox, %method%
- 04 Feb 2016, 08:29
- Forum: Forum Issues
- Topic: 24-hour ban??
- Replies: 14
- Views: 5636
Re: 24-hour ban??
Thanks tank, appreciate ittank wrote:When I get back to a desktop. I'll lift yours manually. Or another mod can whitelist your ip
- 04 Feb 2016, 07:48
- Forum: Forum Issues
- Topic: 24-hour ban??
- Replies: 14
- Views: 5636
Re: 24-hour ban??
Hi tank, thank for your response. I see, no worries. I guess I'll just lurk around and wait this one out.
- 04 Feb 2016, 07:14
- Forum: Forum Issues
- Topic: 24-hour ban??
- Replies: 14
- Views: 5636
24-hour ban??
I was replying(as guest) to post when I got a "Take a break" message. So I opted to login using my forum credentials but then I was greeted with a 24-Hour ban message for "spamming". Screen clip of the ban message:
- 04 Feb 2016, 07:09
- Forum: Ask for Help (v1)
- Topic: Strange Behavior Removing XML Nodes !?
- Replies: 3
- Views: 1286
Re: Strange Behavior Removing XML Nodes !?
Untested: Inside your loop, replace all instances of A_Index with A_Index - 1. XML collection/list items are 0-indexed.
- 30 Jan 2016, 02:45
- Forum: Scripts and Functions (v1)
- Topic: JSON 2.0 (and Jxon) - JSON lib for AutoHotkey
- Replies: 77
- Views: 68152
Re: JSON 2.0 (and Jxon) - JSON lib for AutoHotkey
Updated (commit 43cb649) - Fixed a minor issue
- 27 Jan 2016, 12:49
- Forum: Scripts and Functions (v1)
- Topic: JSON 2.0 (and Jxon) - JSON lib for AutoHotkey
- Replies: 77
- Views: 68152
Re: JSON 2.0 (and Jxon) - JSON lib for AutoHotkey
@SifJar, I've fixed the issue you can do the following: #Include JSON.ahk FileRead, test, test.json example := JSON.Load(test) str1 := JSON.Dump(example, Func("testReplacer")) MsgBox % str1 testReplacer(this, key, value*) { ; Initially 'replacer' gets called with an empty key("") representing the ob...
- 27 Jan 2016, 12:27
- Forum: Scripts and Functions (v1)
- Topic: JSON 2.0 (and Jxon) - JSON lib for AutoHotkey
- Replies: 77
- Views: 68152
Re: JSON 2.0 (and Jxon) - JSON lib for AutoHotkey
Updated (commit 6aaeb3d ): Load() - remove static variable null . This should make it AHK_H-compatible(untested) Dump() - improve skipping of non-serializable objects such as COM, Func, BoundFunc, FileObject, etc. Added JSON.Undefined , a proxy for the JavaScript undefined type for use with reviver/...
- 25 Jan 2016, 09:26
- Forum: AHK Studio
- Topic: AHK Studio
- Replies: 1179
- Views: 629422
Re: AHK Studio
but is not able to respond to the fileappend. If I get some time I will try to see if the fileappend method can be hooked into @maestrith: The sample script in my post here demonstrates a "non-blocking" stdout(or stderr) read. The easier option is to use WScript.Shell 's Exec() but it lacks control...
- 18 Jan 2016, 06:33
- Forum: Ask for Help (v1)
- Topic: [Solved] Method() setting values in array that never called it
- Replies: 6
- Views: 1758
Re: Method() setting values in array that never called it
Calling GetTool() again will assign a new object to this.Tool, overriding the previous value. If it's not your intention, you're better of initializing this.Tool as an instance variable.
Code: Select all
class Machine {
Name := ""
Tool := []
; ...
- 18 Jan 2016, 06:25
- Forum: Ask for Help (v1)
- Topic: [solved] ActiveX: Shell.Explorer vs HtmlFile, border-radius
- Replies: 12
- Views: 8282
Re: ActiveX: Shell.Explorer vs HtmlFile, border-radius
Here's a solution if you want to avoid the registry. I use this all the time.
Usage:
Usage:
Code: Select all
Gui Add, ActiveX, vWB w800 h600, about:<!DOCTYPE html><meta http-equiv="X-UA-Compatible" content="IE=edge">
document := WB.Document
document.open()
document.write(html)
document.close()
; ...