-
Posts
12 -
Joined
-
Last visited
Everything posted by Zvend
-
Thanks for taking the time to reply to my question. Some of the infos were quite useful but my main complaint is, that nothing (or the most of it) of that is really clear stated on the wiki. You left some my questions open or indirectly replied to them. 2) Lets suppose i have 100 constants and i define them in an optional file, like the wiki told me to. How do i use the constants in my UDF without including the constant file itself and to not declare the constant twice? The only logical result for me is to use magic numbers, which may make the code unreadable. 4) i was more speaking about that the wiki does not cover enough in my opinion
-
Sure! I pick the examples of the UDF Headers. 1) "Non standard libraries can be used if necessary, but this should be documented and linked to so users can download it as well." How do I document it? How should I link it? What should I link? (Direct Download link?, repo?, ..?) 2) The next thing that is unclear are Constants. Yes it seems pretty clear looking at this: I understand I shall declare them in a different file, when they are optional. But this causes a conflict in my head with: "Not use any magic numbers. Ever. None. At all. No excuses." When I make constants optional, how do I use their values in my code without creating magic numbers and without making them a dependency by including them? 3) The whole file header is confusing. Example: In Other Sections it says "Other sections, in order of appearance, are as follows." Okey but then it tells you under Listing: "It MUST be the second defined header item after #Index" (4)) The wiki is unformatted and I don't have mood to parse the example, cause I already saw it doesn't cover every thing to take care of in an UDF that might has to deal with every case. Making it hard to present a correct UDF. (5)) How can I include my UDF in my local Help File? I want to see if it parses correctly and in general building the Help File yourself would be cool. I googled a lot about it and all I found were some custom approaches of creating an Help File which then lacks not having the default AutoIt entries. This is just a recent example I have. There are more but I currently don't have the time to review it to exclude false statements from me. As a general rule, you really have to dig deep to find stuff that is actually useful to know, which is sad in my opinion but easy changable.
-
oh thank your very much! I hope i still hit the correct subforum. Another related thing to "wiki" and AutoIt in general: I wish there would be more updates for the Wiki with better explanations and also correct naming conventions or UDF Headers. I think the wiki could be a much better place than it is right now. Def. missing the part about bad practises about some insights in AutoIt. E.g. about DllStructs. They sometimes do behave odd when they dont have a fixed address previously called malloc. I sadly deleted my example yesterday, cause it frustrated me. I had to pass the same struct a few times through different functions and even ByRef didnt work. I stored a BYTE[10000] and have set the value to the binary data of a file. It was a local Struct. But at some point the data changed but the pointer didnt. And the funny thing i didnt edit the data, i only read from it and created sub structs with the ptr of the main struct + an offset. How can i know if AutoIt allocates more memory than I actually wanted it to make (example the substructs). Long story short, I wish there would be one place in the wiki with neat tricks. Would sneak into the code to understand it myself but its sadly not open source anymore. Which would be cool to have the community code for AutoIt features and enhance the project more, since it feels like the interest of adding more features fall asleep. I wish AutoIt had some features about better memory management.
-
Yea i jsut read up, i need 20 posts on this forum. I almost never have a question than reporting bugs. Im kind of good in googling, debugging and experimenting. Will probably take another year to get 20 posts.
-
-
I hope this is the right section, caused i clicked through every subforum and still might be wrong. Anways going through https://www.autoitscript.com/wiki where it shows code snippets seems broken. Every code snippet is not formatted or incorrect formatted. Tried to register for the wiki but didn't find anything. Im using chrome Version 113.0.5672.93 (Official Build) (64-bit) but i have tested it with a few other browsers, also used 2 seperate PCs and checked it on my mobile phone. My friend has the same issue. Here an example of what i am talking about: Thank you in advance!
-
Intresting approach, this makes it for sure. I was just hoping for an more official way from autoit. I need a bit of backwards compatibility and to correct myself, i forgot to mention that the script is not executable after compiling it and some values of the array are 2048 bytes long :] So the Temp Array solved this. thank you! Unless somebody wanna share a different approach how to handle such situations, this topic is done
-
I dont think you read my post correctly. Its not about the size of the array. It is about the line limit permitted by autoit, which is 4095. (Ref: Here, line 3: MAX_LINESIZE) It is a predefined infrastructure from my company in c++. So it must be constant. And even tho 512 is not "large", it is big enough to be bigger than 4095 bytes to fit in one line and make the script not executable.
-
so i have come across a problem declaring a large const array. I have a ~500 index big array which i want to be a const, bcs of not changing the contents obviously. I did that before without a problem like this Global Const $LARGE_ARRAY = [ _ 0, _ ;~ Index 0 5, _ ;~ Index 1 12, _ ;~ Index 2 ;~ <...> 7, _ ;~ Index 511 25 _ ;~ Index 512 ] this works fine until a certain point, bcs the autoit stripper is turning the '_' into one line again and it is exceeding the autoit line limit, which causes the script not to start. I have to remove the Const identifier, so i can solve it this way: Global $LARGE_ARRAY[513] $LARGE_ARRAY[0] = 0 $LARGE_ARRAY[1] = 5 $LARGE_ARRAY[2] = 12 ;~ <...> $LARGE_ARRAY[511] = 7 $LARGE_ARRAY[512] = 25 which solves the problem. but now it is not a const anymore which I really want. I came onto the idea declaring a local variable inside a function this way and save the result into a global const on startup but it does not feel correct to me. Can anybody enlighten me on a feature i havent found in the helpfile yet?
-
Hex Number Arithmetic is incorrect on v3.3.16.0
Zvend replied to Zvend's topic in AutoIt General Help and Support
I removed the solution mark and rather comment here, that I did open a ticket. If the ticket got accepted and fixed I will mark this as solved. Thanks for the advice, I absolutely did not see the ticket section. -
Hex Number Arithmetic is incorrect on v3.3.16.0
Zvend replied to Zvend's topic in AutoIt General Help and Support
yes that works for hardcoded offsets. i have a function in my Dll that passes me offsets which can be positive and negative. If $nOffset >= 0 Then ConsoleWrite("Offset is positive." & @CRLF) Else ConsoleWrite("Offset is negative." & @CRLF) EndIf I dont want to go through 42k lines and test everything if it is correct, bcs for me this is clearly a bug -
@Jon So I ve been upgrading my softwares to v3.3.16.0 and nothing was working anymore. I am using couple of C Dlls within my autoit scripts. For this I need Pointer and structs logic. And whenever I am working in the address area i only use hex values. But now this is breaking everything. Here is my test: ;~ AutoIt v3.3.14.5 Const $OFFSET = -0x46 Local $pSomePointer = Ptr(0x3100000 + $OFFSET) ConsoleWrite("Pointer is: " & $pSomePointer & @CRLF) Out: Pointer is: 0x030FFFBA (Correct hex arithmetic) Newest Version: ;~ AutoIt v3.3.16.0 Const $OFFSET = -0x46 Local $pSomePointer = Ptr(0x3100000 + $OFFSET) ConsoleWrite("Pointer is: " & $pSomePointer & @CRLF) Out: Pointer is: 0x03100046 (Incorrect hex arithmetic) Will there be any fix soon for this? Thank you for reading Zvend