Search found 277 matches

by _3D_
28 Feb 2020, 05:04
Forum: Ask for Help (v2)
Topic: [a108] meta function __Call
Replies: 4
Views: 2129

[a108] meta function __Call

Code: Select all

class A108 {
	static __Call(arg, *) {
		MsgBox(type(this) ' has not method ' arg)
}	}

A108.unk('Test')

a:= A108.new()
a.unk('Test') ;__Call not exist
I dont understand why static members not visible in instance?
by _3D_
23 Feb 2020, 13:40
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103617

[a108] Class Debug

There will not be comments because of disagreement with changes in AHKv2.0 class Debug { ;using class as superglobal var --------------------------------- static File:= '' ;log file static out( cond:='' ;rule condition , mess:='' ;debug message , valu:='' ;if condition message , zero:='') ;if !condi...
by _3D_
23 Feb 2020, 03:04
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

Re: [ ??? ] FileOpen() Exception

So why do you want the error on the second line and not on the first? What if the second line doesn't occur until much later (away) from the first line? I don't expect you to answer that. Cheers. Actually I don't want any errors in any order. I just need a simple method that open a file, and a simp...
by _3D_
19 Feb 2020, 10:42
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

Re: [ ??? ] FileOpen() Exception

The base of ALL again: OpenFile function And brief: Return value If the function succeeds, the return value specifies a file handle to use when performing file I/O. To close the file, call the CloseHandle function using this handle. If the function fails, the return value is HFILE_ERROR. To get exte...
by _3D_
17 Feb 2020, 07:42
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

Re: [ ??? ] FileOpen() Exception

I get: --------------------------- AutoHotkey Script (neu) (6).ahk --------------------------- Error: Es wurde versucht, auf ein Token zuzugreifen, das nicht vorhanden ist. Specifically: 1008 Line# ---> 001: file := FileOpen('*', 'w') 003: file.write("Test") 004: file.read() 005: Msgbox() 006: Exit...
by _3D_
17 Feb 2020, 07:24
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

Re: [ ??? ] FileOpen() Exception

No you would use try whenever it is needed and makes sense: try { preprocess(fileobject) ; ... actprocess(fileobject) ; ... endprecess(fileobject) } Catch e { if (e.message ~= "Access Denied") { logFeedback("Couldnt open COM: Access denied - This often happens if there is another program open that ...
by _3D_
15 Feb 2020, 05:17
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

Re: [ ??? ] FileOpen() Exception

Fileopen returns A fileobject , not a handle . If it returned 0 you still would have to handle it, or you would get a less descriptive error message when you tried to invoke any of the fileobject methods or properties on the 0 value. If you really want to return 0 , wrap the function, myfileopen() ...
by _3D_
15 Feb 2020, 04:30
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

Re: [ ??? ] FileOpen() Exception

comm:= FileOpen('\\.\COM1', "w") ;file actions It is now, you'll be notified if it fails. Actually this code is that I need - one single line that return HANDLE or 0 if FileOpen fail and A_LastError is the place that I can see what happens. It because opening / acting / closing must be different pr...
by _3D_
15 Feb 2020, 03:39
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

Re: [ ??? ] FileOpen() Exception

It is especially for these that liked exceptions around the simple code: OpenFile function
I think ALL is based on this nature of things. (NO EXCEPTIONS AT ALL)
Must read >>> KISS principle

Enjoy!
by _3D_
14 Feb 2020, 10:44
Forum: AutoHotkey Development
Topic: [ ??? ] FileOpen() Exception
Replies: 28
Views: 8569

[ ??? ] FileOpen() Exception

It is madness: #SingleInstance Force comm:= FileOpen('\\.\COM1', "w") When serial (com1) is taken by another program FileOpen() void exception Access Denied and comm variable keep its value. It is in times easier FileOpen() to return 0 or "" #SingleInstance Force if comm:= FileOpen('\\.\COM1', "w") ...
by _3D_
11 Feb 2020, 05:35
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103617

Function Arguments

Function "generator" (arg)=>()=><expression> is cool, but will we have the same functionality and the function arguments? function(1, 2, 3) function(arg1, arg2, arg3) { MsgBox('ARG1= ' arg1 '`nARG2= ' arg2 '`nARG3= ' arg3) } It is usual code. We see that function arguments look like an Array: functi...
by _3D_
11 Feb 2020, 04:41
Forum: Ask for Help (v2)
Topic: [AHKv2.0-a108][BUG] DllCall
Replies: 8
Views: 2914

Re: [AHKv2.0-a108][BUG] DllCall

AHK v2 going to be more conservative.
Actually I don`t understand why, but fact.
[a108] become next major revise that run the v2 language into the fog.
I'm afraid experiments will reduce the popularity of the language and keep v2 forever alpha.
by _3D_
06 Feb 2020, 06:30
Forum: Ask for Help (v2)
Topic: BUG?msgbox(func()) is ok, msgbox(res := func()) changed
Replies: 4
Views: 2825

Re: BUG?msgbox(func()) is ok, msgbox(res := func()) changed

Try this: mytv() => 'value' MsgBox(mytv()) MsgBox(x:= mytv()) If problem still persist so it is BUG. Else ... It is 1000 lines code try to isolate just this part that you use and make tests. EDIT: I looked text and "houses" in video - probably somewhere in code is missing buffer clear or low buffer ...
by _3D_
04 Feb 2020, 07:00
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103617

[AHKv2.0-a108] Object_Array_Map

As type() not so useful in a108, I revised Object_Array_Map to be more simple. ;Override Object ============================================================== ;Override Object.__Get -------------------------------------------------------- Object.Prototype.DefineMethod('__Get' , (this, name, params*)...
by _3D_
22 Jan 2020, 09:16
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103617

[AHKv2.0-a108] Gdip port

by _3D_
22 Jan 2020, 09:07
Forum: Ask for Help (v2)
Topic: [AHKv2.0-a108][BUG] DllCall
Replies: 8
Views: 2914

[AHKv2.0-a108][BUG] DllCall

Variables Gdip_GraphicsFromImage(0) ; Gdip_GraphicsFromImage(pBitmap) { DllCall("gdiplus\GdipGetImageGraphicsContext", "Ptr", pBitmap, "Ptr*", pGraphics) ;Type mismatch (pGraphics not init) return pGraphics } /*------------------------- 108 - TEST.ahk --------------------------- Error: Type mismatc...
by _3D_
17 Jan 2020, 07:32
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 103617

[AHKv2.0-a108] type_Is() / type_Of() / type_Me()

[AHKv2.0-a108] type_Is(this, type) This function check is this can be represent as type (is in this inheritance chain type type ). type_Is(this, type) { try while(this.__Class != 'Any') if((this:= this.base).__Class == type) return 1 return 0 } type_Of(this) This function return inheritance chain s...
by _3D_
16 Jan 2020, 07:29
Forum: AutoHotkey Development
Topic: [AHKv2.0-a108] Understanding Types
Replies: 0
Views: 2277

[AHKv2.0-a108] Understanding Types

It is side effect from https://www.autohotkey.com/boards/viewtopic.php?p=309928#p309928 TypeOf(this) { ;str:= '' while(this.__Class != 'Any') { str .= this.__Class '.' this:= this.base } return str 'Any' } This simple function can show how Classes / Objects / Numbers and so on is present in AHKv2.0-...
by _3D_
16 Jan 2020, 05:00
Forum: AutoHotkey Development
Topic: [SUGGEST][AHKv2.0-a108] types
Replies: 6
Views: 3624

Re: [SUGGEST][AHKv2.0-a108] types

class FuncModel { } would break your idea. nnnik is right. If type string contain some 'Type' it is not the solution. variable.HasMethod('Call') Very elegant solution from swagfag but actually not the complete solution. class ClassFunction { Call() { MsgBox('ClassFunction') } } class holder { __New...
by _3D_
15 Jan 2020, 05:31
Forum: AutoHotkey Development
Topic: [SUGGEST][AHKv2.0-a108] types
Replies: 6
Views: 3624

[SUGGEST][AHKv2.0-a108] types

In AHKv2.0-a108 I found 3 types of functions: "Func" "BoundFunc" "Closure" => I suggest "Closure" to be changed to "ClosureFunc" . In this case ALL 3 types will contained "Func" and will be separated from non functions. Will be cool if "is" to work like: if value is "Func" ;return TRUE if type of va...

Go to advanced search