How to create static var inside class that is separate from any other initialized object? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
smarq8
Posts: 49
Joined: 16 Jan 2016, 00:33

How to create static var inside class that is separate from any other initialized object?

12 Aug 2018, 13:21

So i am currenty writing class for Serial communication. Until now i use only one FIFO buffer for rx and everything work fine, but now i need to add tx buffer and here begin my problem because for rx and tx share same memory space (bot buffer has the same address). So is it possible to make buffer separate from each other? I know i can declare static buffers outside FIFO class and pass as ByRef parameter but I am wonder can I do everything inside my FIFO class?
By the way I am also wonder can I be sure that address of any buffer never change during executing script?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Helgef
Posts: 3093
Joined: 17 Jul 2016, 01:02
Contact:

Re: How to create static var inside class that is separate from any other initialized object?  Topic is solved

12 Aug 2018, 13:35

Code: [Select all] [Download] GeSHi © Codebox Plus

this.setcapacity("buf", _size)
this.adr := this.getaddress("buf")

It doesn't initialise the memory to zero though.

Cheers.
smarq8
Posts: 49
Joined: 16 Jan 2016, 00:33

Re: How to create static var inside class that is separate from any other initialized object?

12 Aug 2018, 13:48

Thanks, it probably does work fine now.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Ask For Help”

Who is online

Users browsing this forum: asghar5676, dee1337, IsaacElenbaas, ivyandrei, MIRKOSOFT and 53 guests