AutoHotkey Community

It is currently May 24th, 2012, 10:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: April 12th, 2007, 8:45 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
corrupt wrote:
Do you have any specific cases in mind that would benefit from this optimization?

Yes. Everything. :D
API structures, like I said, almost by rule need to be initialised only on 1 or two places.

Quote:
Using the current methods, the speed here will also depend on which members need to be updated. I can see that this could help optimize repeatedly setting or retrieving only certain members in a struct in a loop but I'm not sure if there are many cases where this optimization would be necessary.

I understood from your post that you iterate members in loop. Right ?
If so, I would choose assotiative global array, in the manner

    structlib_aMember[%name%] := type, offset

then when I say to u update name=Bottom in RECT you have your data in
    structlib_aMember[Bottom]

and you can update only that member. So, the offset of parameter is not important, and all parameters are equal.

I really think lexikos has a point and that you should reconsider adding alternative syntax to StructRect while keeping existing

StructCreate( sDEF ) is not something you can put now as your current implementation accepts more then 1 param. So you can check if only 1 param is there, to treat it as struct definition that can look like:

    line1 struct name
    line2 field1 as type1
    line3 field2 as type2
    ...



lexikos wrote:
I do. You do. Anyone else who needs to grab text from a remote TreeView does.

No I don't. I needed that 10 times total out of which 2 times using AHK.
You can't possible give that as an argument anyway. Its far away land that I got little closer here:
http://www.autohotkey.com/forum/viewtop ... =functions
http://www.autohotkey.com/forum/viewtop ... =functions

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2007, 1:37 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2537
majkinetor wrote:
corrupt wrote:
Do you have any specific cases in mind that would benefit from this optimization?

Yes. Everything. :D
API structures, like I said, almost by rule need to be initialised only on 1 or two places.
I understand what you are saying in general but currently 1 member can be updated separately and updating a few instead of all will only give considerable savings if a fairly large struct needs only a few members updated frequently in a loop.

majkinetor wrote:
I understood from your post that you iterate members in loop. Right ?
If so, I would choose assotiative global array, in the manner

    structlib_aMember[%name%] := type, offset

then when I say to u update name=Bottom in RECT you have your data in
    structlib_aMember[Bottom]

and you can update only that member. So, the offset of parameter is not important, and all parameters are equal.
Once this becomes possible in AHK without having to create many separate global variables, it will likely get implemented. As I mentioned, the previous version had used separate global variables and, although more efficient, was a mess when listing variables once several structs were used. This change also has the potential of making the request to update several members at once unnecessary as there would likely be a considerable speed improvement for larger structs.

majkinetor wrote:
I really think lexikos has a point and that you should reconsider adding alternative syntax to StructRect while keeping existing

StructCreate( sDEF ) is not something you can put now as your current implementation accepts more then 1 param. So you can check if only 1 param is there, to treat it as struct definition that can look like:

    line1 struct name
    line2 field1 as type1
    line3 field2 as type2
    ...
I'll consider modifying the existing function to support using only 1 param but I might go with adding an alternate function instead. The main reason is that the change won't likely improve speed or functionality but will offer an alternate syntax. Two styles of syntax are already possible. I'm not sure that adding a third style is necessary. You may already realize this but the syntax you suggested is also different from the syntax that lexikos suggested. This method might also run slower depending on how it gets implemented due to additional parsing that isn't currently required if I try and build support into the existing function.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2007, 3:57 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
corrupt wrote:
You're probably aware, but the current function will also allow something like the following to improve readability:
Code:
StructCreate("RECT", "Left As Int", "Top As Int", "Right As Int", "Bottom As Int")

I'm aware, but I prefer the other method. :) It seems to me that "As" might be more easily understood by people who aren't familiar with non-Basic languages. Also, I have plenty of C# and UnrealScript experience, so it seems more natural to me for the type to be first, followed by the name (as in "int left".)

Eventually I'm going to try making a function generator for accessing structs. The definition of the struct need not be parsed more than once (ever), so a generator for Extract/InsertInteger wrapper functions might work well. (As in: you run the script over a struct definition once, and it spits out functions to paste into another script.)

I wrote some example usages so that I wouldn't forget my ideas. These are based on the TVITEM structure used to retrieve TreeView items:
Code:
; Syntax: %VAR% := get_%STRUCTTYPE%_%FIELD%(%PTR%)
mask := get_TVITEM_mask(tvItem)
; alternatively
; Syntax: get_%STRUCTTYPE%_%FIELD%(%PTR%, %VAR%)
get_TVITEM_mask(tvItem, mask)
; Syntax: set_%STRUCTTYPE%_%FIELD%(%PTR%, %VALUE%)
set_TVITEM_mask(tvItem, mask)
; constructor (with optional parameters)
; Syntax: %STRUCTTYPE%_Create(field1="", field2="", ...)
tvItem := TVITEM_Create(mask, hItem, , , pText, textmax)

Once the functions are generated, you have no need to store any struct "metadata" (like field names and offsets), as it's all hardcoded into the generated functions. I imagine this would make it much more efficient.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2007, 5:46 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
lexikos wrote:
I wrote some example usages so that I wouldn't forget my ideas.

Some of us already thought a lot about this, and there was discussion around few times. I am positive that you can not offer anything more convenient than what we concluded so far. Take a look here to see one approach.

corrupt wrote:
I understand what you are saying in general but currently 1 member can be updated separately and updating a few instead of all will only give considerable savings if a fairly large struct needs only a few members updated frequently in a loop.

Didn't know about that. One member is not enough. 2 or 3 are.


Quote:
Once this becomes possible in AHK without having to create many separate global variables, it will likely get implemented. As I mentioned, the previous version had used separate global variables and, although more efficient, was a mess when listing variables once several structs were used. This change also has the potential of making the request to update several members at once unnecessary as there would likely be a considerable speed improvement for larger structs.

So, you decided to sacrifice "more efficent thing" for "variable listing" that ppl hardly use, and only while creaating the script, while they run "efficently bad thing" for eternity :?: :idea:

Quote:
I'll consider modifying the existing function to support using only 1 param but I might go with adding an alternate function instead. The main reason is that the change won't likely improve speed or functionality but will offer an alternate syntax. Two styles of syntax are already possible.

I don't consider functions to which I have to pass 30 arguments as efficient. There is a reason for reference around. Also, with your 2 variatns its not possible to create structures dynamicaly as you must call function with some already known number of parameters - if you know it will be 10 ok, but what if I don't know ? What if it can be 2, or 5 or 100 ? Your second approach doesn't offer new functionality, just alternative syntax for the same thing which is nice to have mainly for n00bs. However, we are dealing here with topics n00bs will not approach, generaly. The thing I proposed offers new functionality and faster working (although we concluded performance is not the issue with create function )

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2007, 2:41 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
majkinetor wrote:
Some of us already thought a lot about this, and there was discussion around few times. I am positive that you can not offer anything more convenient than what we concluded so far. Take a look here to see one approach.

I agree that those wrappers make a certain selection of functions more convenient, but there are a couple of problems (at least from my perspective):
  • Wrappers must be manually created for each struct and function.
  • It uses global variables...
I am not planning on replacing existing wrapper methods, but creating a script that auto-generates wrappers for other structs. Ideally, the generated wrappers will not rely on global variables.

As for ahkstructlib, if it suits you, use it. I have my own preferences for syntax, so I will write my own struct code. Efficiency (i.e. parsing definitions and arguments) is a side-issue (not important, I guess.) If for no other reason(s), I'll write it to excersize my brain. I'd be interested to see the results of benchmark comparisons.

At the moment, I am scripting for "fun." If I was trying to achieve a specific purpose, I'd consider using ahkstructlib. I also don't like to use code that I don't fully understand. At least with my unreadable code, I (usually) remember what it does.
Quote:
Also, with your 2 variatns its not possible to create structures dynamicaly as you must call function with some already known number of parameters - if you know it will be 10 ok, but what if I don't know ? What if it can be 2, or 5 or 100 ?

Can you give an example where the structure is not known at run-time? Generally speaking, the structure will be known before the script runs, so the definition-parsing need only be done once, if possible. After all, structs in C(++) etc. don't change after the program is compiled...
majkinetor wrote:
lexikos wrote:
I do. You do. Anyone else who needs to grab text from a remote TreeView does.

No I don't. I needed that 10 times total out of which 2 times using AHK.
You can't possible give that as an argument anyway.

Just because you say it, doesn't make it so. You pointed me at your TreeView functions, which most absolutely, most certainly, use memory belonging to an external process. My argument is that it is necessary to use "remote process memory" when retrieving text from TreeViews and ListViews. Whether the implementation is hidden from the user (scripter, programmer, etc.) is irreleveant.

(Your original statement was "How many ppl use remote process memory? 0. Correct." I guess it's statements like these that provoke me--they are impossible to prove correct, yet incredibly easy to prove incorrect. I, for one, know that at least 1 person uses it.)

majkinetor,
One last thing, about the API wrappers. In RECT_Set(), you set the capacity of %var%_c, but then you use %var%... Is this intentional, or should you really be setting the capacity of %var%? What is %var%_c?
Code:
RECT_Set(var)
{
    global

    VarSetCapacity(%var%_c, 16 , 0)  ; <==== SEE HERE: "%var%_c"
    InsertInteger(%var%_left,   %var%, 0)  ; <==== you insert integer into "%var%"...
    InsertInteger(%var%_top,    %var%, 4)
    InsertInteger(%var%_right,  %var%, 8)   
    InsertInteger(%var%_bottom, %var%, 12)   
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2007, 10:07 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
At the moment, I am scripting for "fun."

I see. The only right way, anyway ;)

Quote:
Wrappers must be manually created for each struct and function.
It uses global variables...


- Yup, I didn't create this as universal solution, but as an convinient way to use structures when you don't want to use universal solutions. :)

- You will have to abandon your attitude about global variables. Thats AHK failure, not mine. I suggested number of times to Chris that there should be a way for explicitely free variables not used any more.
However there is way to use global variables over multiple functions using statics. This requrie function call to get pseudo-global, but doesn't cloud the variable space. Anyway, its not worth the effort although its trivial thing to do. AHK is full of such things and you will jump from one to another. AHK will grab you sooner or later. This is just a 10-liner language and it isn't designed for anything serious. If you keep that in mind, you may save a lot of your time. I know I wasn't do right things in AHK. I general did what I wanted but all of my free time was sacreficed during previous year. AHK is esasy to use for 10 line scripts, but after a year of very very serious usage, it still surprises me every day.

Quote:
As for ahkstructlib, if it suits you, use it.

Well, if everybody thinks that way, then we will get bunch of "I did it just for me and if it suits you use it" things. Do I have to tell you what is Open Source programming ? Do I have to tell you that scritps you make should constantly evolve based not only on your preferences, habits and ideas? Do I really have to tell you that programmers should not have to be so selfish ?

Quote:
Can you give an example where the structure is not known at run-time? Generally speaking, the structure will be known before the script runs, so the definition-parsing need only be done once, if possible. After all, structs in C(++) etc. don't change after the program is compiled...

The fundamental mistake of 99% of programmers is that they THINK they know how will thing be used. You can't tell me how to programm you know? Maybe I want for some reason to use 5 structures and to define them real time because of this or that. Maybe I'll do that with only 1. Maybe I want to create plugins that can define their own structures out of basic building blocks, that plugin-host can use... You don't know and you shouldn't think about how your module will be used. You should create it to be as good as possible which means lot of things - sophistication, performance, easy of use, zero-configuration etc. OF course, if you want to create it for community. If you don't, then you can make it to load its parameters from the Mars using your own Mars-scanning hardwer if you like.

Quote:
(Your original statement was "How many ppl use remote process memory? 0. Correct." I guess it's statements like these that provoke me--they are impossible to prove correct, yet incredibly easy to prove incorrect. I, for one, know that at least 1 person uses it.)

Oh, a litteral guy. Ok, so its not zero. Its 1 or 51 ppl out of 6 billion ppl on this planet. So, mathematicaly speaking I was not wrong. It is zero, as it is leaning toward zero. Mathematicaly speaking.

Quote:
One last thing, about the API wrappers. In RECT_Set(), you set the capacity of %var%_c, but then you use %var%... Is this intentional, or should you really be setting the capacity of %var%? What is %var%_c?
Yes, I latter changed this to be more consistent, so I now use like I wrote in example but I obviously didn't update the scripts on all places. Anyway, you just have to remove _c everywhere I missed. You can fix the wiki realtime.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 3:35 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
majkinetor wrote:
- You will have to abandon your attitude about global variables.
Wrong. My attitude is to avoid using them when they are not necessary. In the case of structs, I am certain it will be possible without necessarily using global variables. After all, using Insert/ExtractInteger you can support structs without global variables.

The only issue I can think of is when a struct contains a string (that needs a seperate variable or block of memory.) There would still be ways other than global variables, but perhaps not ideal ways.
Quote:
I suggested number of times to Chris that there should be a way for explicitely free variables not used any more.
In some instances (such as with structs!), there is--use external memory management functions. The only problem with that is you must explicitly release the memory, and losing your pointer to the memory would make that impossible. Of course, then it's your fault for losing the pointer. :P

The lack of built-in language support for freeing variables is the very reason I avoid using globals as temporary variables.

As an example, what if you needed to create 100 structures (POINT, for example), temporarily inside a function? You'd then have 400 global variables- 100 POINTs, 100 POINT?Xs, 100 POINT?Ys, and 100 redundant definitions of the POINT struct.

Probably a bad example, though, as you could manually create 1 (800 byte) variable, then use Insert/ExtractInteger to set/get each POINT. That would save the overhead of (at least) 99 AHK variables...
Quote:
This is just a 10-liner language and it isn't designed for anything serious.
For any "serious" programming, I'd use C#. However, there are things I will want to do in AutoHotkey that require the use of structs.
Quote:
Well, if everybody thinks that way, then we will get bunch of "I did it just for me and if it suits you use it" things.
I was referring to ahkstructlib. (To state the obvious,) I did not write that. I never said I would write my own API just for me. Heck, if I was doing it only for myself you never would have known I was planning on doing it.
Quote:
Do I have to tell you what is Open Source programming ?
Not everyone believes in the Open Source philosophy. I strongly believe, however, it is wrong to force your ideals on another person... (hint, stfu)
Quote:
Do I have to tell you that scritps you make should constantly evolve based not only on your preferences, habits and ideas?
So tell me, guru, what should they evolve based on?
Quote:
Do I really have to tell you that programmers should not have to be so selfish ?
My view on humanity is that no-one is motivated to do anything unless it benefits them in some way. The majority of programmers are "selfish." They write code to get paid, not to help other people.
Quote:
The fundamental mistake of 99% of programmers is that they THINK they know how will thing be used.
You still haven't given me a single example of where it would be useful. Anyway, if I made an API that doesn't allow dynamic structure sizes, changing the structure at run-time would be incorrect use of the API. The main use of structs in AHK is with calls to external .dlls, mainly the Win32 ones. Structs in Win32 NEVER change definition at run-time.

One thing I do recognize- it may be useful to change the usage of a field at run-time. For example, instead of assigning a string to a field, you may want to assign a string pointer (e.g. to point to memory from another process.) However, this doesn't mean the structure needs to change- you could simply use a different accessor function.

I'm curious... how much experience do you have with other programming languages?
Quote:
You can't tell me how to programm you know?
I can tell you, doesn't mean you'll listen. :twisted:
Quote:
Maybe I want to create plugins that can define their own structures out of basic building blocks, that plugin-host can use...
Then you'd use a different API. Plain and simple. That is certainly not a common usage, and not what I would have in mind.
Quote:
You don't know and you shouldn't think about how your module will be used.
You should always think about how your module will be used. If you don't, you're certain to have problems. Perhaps what you should be saying is "you shouldn't unnecessarily restrict what your module may be used for."
Quote:
You should create it to be as good as possible which means lot of things - sophistication, performance, easy of use, zero-configuration etc.
I disagree. Ideally, my wrapper-generator should generate SIMPLE (short, efficient, readable) code.
Quote:
So, mathematicaly speaking I was not wrong.
Code:
majkinetorIsWrong()
{
  if (0 != 1 && 0 != 51)
    return true
}
Surely you're not so bad with math that you don't know zero does not equal one? ;) You could say few people use it. Even so, exactly how do you know how many people use it? There's no way you could know.

Also, the fact (or theory) that few people use "remote process memory" is not reason enough to not support it. I'd most likely only support it as an auxiliary function, though, for code simplicity/efficiency reasons.

P.S. I apologise for all the quotes. I like people to know wtf I'm talking about...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 5:11 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2537
One thing that I probably should mention about ahkstructlib2 is that it has been primarily designed for convenience and speed when writing scripts.

You may have noticed that most of the other scripts I have shared don't include ahkstructlib2 if they use structs. In most cases it was included at design time to speed up the design process but later removed. This will hopefully change when/if stdlib functionality gets included in AutoHotkey and if ahkstructlib's functionality becomes a bit more efficient.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 5:47 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2537
majkinetor wrote:
So, you decided to sacrifice "more efficent thing" for "variable listing" that ppl hardly use, and only while creaating the script, while they run "efficently bad thing" for eternity :?: :idea:
Yes. Using global variables would likely make this a lot more efficient but I'd prefer to find another method. I might release an alternate version that uses globals for fun though :) .

Generating functions for each type of struct then including the ones you need to use could possibly be a lot more efficient but doesn't sound as convenient to use. It might be though. A script could then be created that provides a list of structs where a user can select the types they need and copy/paste the necessary functions into their code. Something similar to API Viewer for AutoHotkey code maybe...

Quote:
I don't consider functions to which I have to pass 30 arguments as efficient. There is a reason for reference around. Also, with your 2 variatns its not possible to create structures dynamicaly as you must call function with some already known number of parameters - if you know it will be 10 ok, but what if I don't know ? What if it can be 2, or 5 or 100 ?
The current method doesn't force you to pass 30 arguments and it doesn't care how many members a struct has (if less than 32 - which seemed to be a realistic limit based on Windows API usage). So it could be 2 or 5 or 32 members in the struct since the additional params are optional. Maybe I'm misunderstanding...

Quote:
Your second approach doesn't offer new functionality, just alternative syntax for the same thing which is nice to have mainly for n00bs. However, we are dealing here with topics n00bs will not approach, generaly. The thing I proposed offers new functionality and faster working (although we concluded performance is not the issue with create function )
If you are referring to using 1 param, that doesn't offer any new functionality other than removing the 32 member limit (which might not be necessary). There's a good chance that it will also be slower due to having to parse the input. The current method forces the user to enter the information for each member in a struct separately which saves the function from having to do it. This sounded like a reasonable tradeoff at the time...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 7:16 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
corrupt wrote:
Generating functions for each type of struct then including the ones you need to use could possibly be a lot more efficient but doesn't sound as convenient to use. It might be though. A script could then be created that provides a list of structs where a user can select the types they need and copy/paste the necessary functions into their code. Something similar to API Viewer for AutoHotkey code maybe...

Accessor functions can be fairly convenient, but you are right in that it is still not as convenient as assignment syntax.

I have some experience with parsing structs*, so I plan to write a script that parses struct definitions copied straight from MSDN. I'm also thinking of writing a GUI to customize the generated functions.

* (I wrote C# to parse UnrealScript, which defines structs similarly to Java, C++, C#, etc.)

Here's a comparison of the two styles:
Code:
tvItem?mask := 1
tvItem?item := hItem
struct@("tvItem")

; versus

set_TVITEM_mask(tvItem, 1)
set_TVITEM_item(tvItem, hItem)

You could replace the "set_TVITEM" with something shorter/more convenient, or more similar to assignment syntax (like "TVITEM#mask()" to set and "TVITEM#mask?()" to get), but I believe that would make it more obscure. (Like the initial confusion between struct@ and struct?.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 10:56 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2537
@lexikos - I like the concept since it doesn't require any globals to be created and since you will generally (likely 90% or more of the time) know which types of structs you will need to use in your script, there shouldn't be any issues in #Including them ahead of time. I'm looking forward to the script and GUI that you're planning if you're willing to share the code to them :) .

There are still a couple of disadvantages that come to mind for the type of general usage I had in mind though (unless I'm misunderstanding).

This would still seem to leave the issue of how to use values from a struct conveniently in a script. Functions could be used in place of struct?member variables in many places but it doesn't seem to have the same look and feel and doesn't seem as readable to me. Maybe I need to look outside the OOP "Basic" style syntax box though...

Another issue is that it would be great to be able to include this functionality in a stdlib when/if available for AutoHotkey but might not be practical to include many functions for many commonly used structs vs including 3 or 4 functions that could support the majority of structs dynamically.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 12:05 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
I'm curious... how much experience do you have with other programming languages?

I know more then 30 prog langs. I constantly use around 10 now.

Quote:
majkinetorIsWrong()

I see that you don't know math very well. :lol:


Quote:
You still haven't given me a single example of where it would be useful.
I gave you, but you didn't listen. Probably I have much more XP then you

Quote:
My view on humanity is that no-one is motivated to do anything unless it benefits them in some way. The majority of programmers are "selfish." They write code to get paid, not to help other people.

The majority of everything is low on any scale. Your view on humanity is ofc, yet another of your errors. AHK and many great stuff around are done for passion and curosity.

Quote:
So tell me, guru, what should they evolve based on?

That is your own path. Your guru can't help you here.

Quote:
Not everyone believes in the Open Source philosophy. I strongly believe, however, it is wrong to force your ideals on another person... (hint, stfu)

So what are you doing here ? This is OS projects... Wait.. you mean.. you are not among those ppl but just like to chit-chat about alternative universees ?

Quote:
For any "serious" programming, I'd use C#. However, there are things I will want to do in AutoHotkey that require the use of structs.

LOL. You can't be serious right ?
And what will run your code ? Deep Blue ?

Quote:
The lack of built-in language support for freeing variables is the very reason I avoid using globals as temporary variables.

Well, some kind of scoping exist in all lanugages except in AHK. That doesn't mean I have to degrade my programming just because AHK is not well designed in this manner. Even the most ugly and stupid language of them all, Win Batch, can encapsulate modules better then AHK.

One thay globals will most definitely have an option to be explicitely free ? What are you going to do then ? Rewrite all your scripts to use globals, or just use regular expressions to change this in all .
BTW, if you are worried about number of them, you can stop now, because most of globals you created will be empty once you finish with them and you can have millions of empty ahk variables without any degradation as each empty var requries some very small number of bytes for maintance ( I think 64 )

Quote:
I have some experience with parsing structs*,

With method I presented on wiki, u can use regular expressions to create AHK get and set functions out of MSDN definition. I certanly used them. I have reg exp clipboard plugin. I select MSDN structure and paste it in ahk code as a SET function, then I change RE and paste it again as GET function and it is ready to use. Anyway, you rfinal result that looks like
Code:
set_TVITEM_mask(tvItem, 1)

is not something like expect as good result. In Ideal parallel dimension, we use AHK structs the same way as in C, native language. I described
here and here how can that be achieved now in AHK but nobody listen.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 7:10 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
Quote:
I know more then 30 prog langs. I constantly use around 10 now.
Quantity over quality, eh? :lol:
Quote:
I gave you, but you didn't listen. Probably I have much more XP then you
"Maybe I want for some reason to use 5 structures and to define them real time because of this or that" is NOT an example. An example would include what you might possibly use it for, and what might change. (Not just "for some reason" and "define them real time".) Reasoning apart from "because of this or that" might also be useful.
Quote:
Your view on humanity is ofc, yet another of your errors.

I really don't like your attitude, or your poor Engrish. You have no right to criticize my beliefs.
Quote:
That is your own path. Your guru can't help you here.

Just as I thought, you have no idea what you're talking about.
Quote:
So what are you doing here ? This is OS projects...

I said "not EVERYONE", not "not ME." Besides that, AutoHotkey scripts are not automatically Open Source. Even if I shared my scripts with you, I retain intellectual property. (Although I am not a lawyer, and am unsure about international laws.)
Quote:
LOL. You can't be serious right ?
And what will run your code ? Deep Blue ?
WTF are you talking about?
Quote:
Anyway, you rfinal result that looks like
Code:
set_TVITEM_mask(tvItem, 1)

is not something like expect as good result. In Ideal parallel dimension, we use AHK structs the same way as in C, native language.

That was just an example. The result could be any function name you wanted. Not exactly sure what you mean by parallel dimension, but if you're referring to symmetry, it's got that:
Code:
set_TVITEM_mask(tvItem, value)
get_TVITEM_mask(tvItem, var)
(Alternatively returning a value, as a user preference.)

I'll probably have "constructors", so you can pass in the initial values for the struct with one function call. I was planning on explicitly specifying values (like POINT(x, y)), but that could be adapted to take a "name":
Code:
; not a useful example, but demonstrates the point
p_x := x
p_y := y
POINT_Create("p")

Quote:
I described here and here how can that be achieved now in AHK but nobody listen.

Those suggestions seem to be based around dynamic structs, which is more relevant to ahkstructlib. What I am planning is generated accessor functions which will basically be wrappers for InsertInteger/ExtractInteger, with the correct offsets, etc. So far I've wasted more of my time figuring out how to avoid global variables and still properly support string fields (with some success!)

corrupt wrote:
I'm looking forward to the script and GUI that you're planning if you're willing to share the code to them :) .

Absolutely. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 7:24 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
Quantity over quality, eh?

Your reaction is typical. You can't handle that. :lol:
ANyway, once you learn that programming language should be choosen according to the task you want to do, you will know the same quantity.


Quote:
I really don't like your attitude, or your poor Engrish. You have no right to criticize my beliefs.

I know you don't like it. I tell things differently then you, and many people ususaly can't handle that because of various vanity variations.
Btw, my English is much better then your Serbian, and only poor poor people can use language distinction as an argument for anything but to prove they are poor.

Quote:
majkinetor wrote:
That is your own path. Your guru can't help you here.

Just as I thought, you have no idea what you're talking about.
Oh, no, I just like to choose my apprentice, not the oposite :lol:

Quote:
WTF are you talking about?

About C#. Did you work in it ? I do every day. Its my job. Next time when you want to discuss C# or dotNet you better go educate yourself a little more. There is well known article around by Mark Rusinovich and the funky crew named "dotNet is comming, I am scared". I can not say I beleive everything he said there or think the same, but that is not far from true.

Quote:
. Not exactly sure what you mean by parallel dimension, but if you're referring to symmetry, it's got that:

I refer to parallel dimension :lol:
You should go reading the work of scientist "David Doitch" and his work on parallel universes, quantum computers etc, if you want to know more. In short there must be parallel dimension in which things are fine, in which AHK can handle structs the ideal way. Its qunatum phicis low. At this point you must choose - international or quantum lows. If you do both, then I guess it will end as quontity vs quolity thingie 8)

Quote:
So far I've wasted more of my time figuring out how to avoid global variables and still properly support string fields (with some success!)

You can just ask me nicely, and I might tell you a secret.

Anyway, welcome to AHK forum. You will see that I am not that evil if you give a chance to the people you think you can understand. :D

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 15th, 2007, 2:50 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7501
Location: Australia
majkinetor wrote:
Quote:
WTF are you talking about?

About C#. Did you work in it ? I do every day. Its my job. Next time when you want to discuss C# or dotNet you better go educate yourself a little more.

eh? Why exactly must I go educate myself a little more? At what point were we discussing C#? All I was saying was that is the language I would use, because I don't know much C++. (I've tried a few times to put C++ to use, but it always comes down to a lack of sufficient reason to put the effort in.)

And exactly why can't I "be serious" (as you put it) about using C#? "And what will run your code?" WTF IS THE POINT YOU ARE TRYING TO MAKE!?? My computer will run the code, most obviously.
Quote:
I refer to parallel dimension :lol:
Okay, now I understand your sentence. It would've made more sense to say "Ideally, we would use AHK structs...etc."
Quote:
You can just ask me nicely, and I might tell you a secret.
No thanks, I've already come up with my own solution.
Quote:
Anyway, welcome to AHK forum.
Thankyou. :)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], mc-lemons and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group