Jump to content

sugi

Active Members
  • Posts

    431
  • Joined

  • Last visited

About sugi

  • Birthday 02/19/1982

Profile Information

  • Location
    Hamburg, Germany

sugi's Achievements

Universalist

Universalist (7/7)

0

Reputation

  1. Hello, I'm trying to use Tidy to clean up my sourcecode and want just one empty line between my function declarations. However I cannot seem to figure out the options for Tidy. I've been playing around with the /reel and /rel parameters, but I cannot seem to figure them out. /reel seems to be ignored (or I dont understand it's purpose), it doesn't even remove one line if there are 20 empty lines. /rel always seems to remove every empty line, no matter if I use "/rel=2" or "/rel 2". According to the documentation there are these options: *** Remove Empty lines from Script Source. 1=Remove all 2=Remove all more then 1 Remove_Empty_Lines=1 Remove_Empty_Lines=2 and the corresponding command line options seems to be: /r_empty_lines or /rel Can anyone point me to what I'm missing here?
  2. I'm not looking for any command. I am just asking if the following working solutions will also be supported in future AutoIt version, or if the first one might not be supported in later version. Version 1: Global $temp[10000] Global $array[1000] For $x = 0 To UBound($array) - 1 For $y = 0 To UBound($temp) -1 $temp[$y] = Random() Next $array[$x] = $temp Next MsgBox(64, 'Memory allocated', '') For $x = 100 To 800 $array[$x] = 0 Next MsgBox(64, 'Memory freed', '')oÝ÷ ÙW«²*'Ù«­¢+Ù±½°ÀÌØíѵÁlÄÀÀÀÁt)±½°ÀÌØíÉÉålÄÀÀÁt)½ÈÀÌØíàôÀQ¼U ½Õ¹ ÀÌØíÉÉ䤴Ä(%½ÈÀÌØíäôÀQ¼U ½Õ¹ ÀÌØíѵÀ¤´Ä($$ÀÌØíѵÁlÀÌØíåtôI¹½´ ¤(%9áÐ($ÀÌØíÉÉålÀÌØíátôÀÌØíѵÀ)9áÐ)5Í ½à ØÐ°Ìäí5µ½Éä±±½ÑÌäì°ÌäìÌäì¤)½ÈÀÌØíàôÄÀÀQ¼àÀÀ(%¥´ÀÌØíÕµµålÅt($ÀÌØíÉÉålÀÌØíátôÀÌØíÕµµä)9áÐ)5Í ½à ØÐ°Ìäí5µ½ÉäÉÌäì°ÌäìÌäì¤ Currently both works. However the helpfile says regarding Version1 Will Version 1 (line 11) work in future AutoIt versions, or will I have to use Version 2 (line 11 + 12) to avoid problems with future AutoIt Versions?
  3. So you are changing the code to reflect the same change you did in the filesystem, and it doesn't work anymore? Then why is the code irrelevant? It's a major part of what is going on, so it IS important.The code snippet I gave you above checks if the file contained within $file actually exists. Of course that's just a basic check, but considering that AutoIt seems to be unable to run the given file it is an important check.
  4. Let's assume I have a few big arrays within another array: #Include <Array.au3> Global $temp[100000] Global $array[5] For $x = 0 To UBound($array) -1 For $y = 0 to UBound($temp) -1 $temp[$y] = Random() Next $array[$x] = $temp Next Now the array at $array[1] can be deleted and I want AutoIt to free up the memory. But without rearranging the arrays that follow on $array[2], $array[3], ... Basically I'm looking for a label "No array here! Check the next one!" Of course I could create a dummy array and insert that, but that's more complicated. What is safe for future AutoIt releases?
  5. And what is that supposed to tell me? Another way to write my test script?
  6. When thinking about how to store data in memory within my new project, I noticed something I did not know about since I started with AutoIt 3 about 4 years ago: It's possible to store a complete array within another array. #Include <Array.au3> Global $temp[3] Global $array[5] For $x = 0 To UBound($array) -1 For $y = 0 to UBound($temp) -1 $temp[$y] = Random() Next $array[$x] = $temp Next _ArrayDisplay($array) For $x = 0 to UBound($array) -1 $temp = $array[$x] _ArrayDisplay($temp) Next This is a very nice feature. Just... the helpfile clearly says "just one datatype in an array", so what if I want to remove an array from the array, without having to reorder the whole array? Can I just say $array[3] = 0, or do I have to create a dummy array with Dim $dummy[1] and then set $array[3] = $dummy? Currently both would work, but I'm talking about the future here.
  7. So you do not have a problem running AutoIt scripts, instead you have a problem while using the Run-function? Maybe you should clarify exactly what you are trying (with example code). If it's really the Run-function then you should try something like this: $file="what_ever_I_want.exe" MsgBox(64, 'Run', 'Fileexists: ' & FileExists($file) & @crlf & $file) Run($file) That way you can confirm what exactly you entered and if the file actually exists.
  8. Thank you smashly, that seems to be exactly what I was looking for!
  9. See if double-clicking on c:\program files\autoit3\autoit3.exe works. If not, you got a general problem running .exe-files. If that works it's just the registry for .au3 files that's broken. Shift-Rightclick on an .au3 file and choose "Open with...", then select autoit3.exe, choose to remember the setting and you should have it working again.
  10. Hello, I need to figure out how to calculate the width that a checkbox needs to have to show the full text. At the same time, wasting space by oversizing them is not an option, because I have to place an input field right next to it. Basically the GUI I have to create looks like the following (with a non-fixed-width font): [ ] Point 1 _____________________ [ ] Point 1.1 ___________________ [ ] Point 1.2 ___________________ [ ] Point 2 _____________________ Where the underscores stand for the input box. If I know how big the checkboxes are, I can size the input box automatically. How can I calculate how I have to size the checkboxes? Thanks!
  11. Well, it's unencrypted, so it's only suitable for a network you trust. The Internet is not a network you should trust... Also, as the connected peers' IP are broadcasted to all others, this means that if two people are behind a NAT and are connecting to a third, the third person will have problems. But as long as all people are behind their own NAT it may actually work. I've never tested it in that way and will probably never test it. Basic rule: If all people can see eachother by the same IPs, there should not be a problem. I wrote it as in our company we do not have any chat available and any form of chat that leaves the companies network (ICQ, MSN, whatever) is considered a security threat and is forbidden. Since my messenger does not send anything out of the network, I can use it without violating any rules.
  12. Hello, I've been pretty silent in the last 2-3 years here in the forums, so I decided to put a script up I wrote some time ago. This is a Peer2Peer messenger. Nothing fancy (e.g. no encryption), but it shows how to handle multiple tcp connections, for those that need an example for it - and I couldn't see another messenger on the forum that was posted with source code. But I have not done a thorough search on this, so I may have overlooked one. As this is a P2P mesenger it does not need a server, but you can just keep it running on one computer to "simulate" a server that the others can connect to. It's also unsuitable for more than a couple of persons, because every messenger connects to EVERY other running instance. And there's a hard limit ($MaxConnections) of 15 connections currently. The PING and PONG functions are currently not used... there's something wrong with my implementation. Details about the protocol used to connect two Instances can be found in protocols.txt. Every Instance broadcasts its own connections to all other peers on a regular interval, so only use this in an environment where you don't have to care about security. After starting it for the first time, you need to go to the Login-Tab and decide on your nick and on a network name, then make sure to press the Apply-button! Next go to the People-Tab and select Connect. Then you need to enter the IP of another Computer running the messenger. The basic idea is: You enter the IP of one computer running the messenger and it will automatically connect to all others, too. The messenger will check all incoming connections to see if they contain the same network name on the Login-Tab - if not, the connection will fail. I am slowly working on this and use this with a few colleagues. It's still very simple, so if you dont need much, you may be able to use it right away. Or you can use it as a starting point for your own messenger or to get some ideas. Anyway, if you got any questions, just post here or send me a message. messenger.zip
  13. Yes. The single quote characters ' are one way to start and terminate a string. Another way are double quote characters ". I just dont understand why you keep mixing them like this: $Key = '"HKEY_LOC....'oÝ÷ Ù.­æ¥+!¢é]aj÷ªê-jÛazËZ®Ú¶¢{^ÚjËkx.W¬³*.z0{¶° Z²'­ëêk¡¹^+0Ømä^jâµç(f§u«­¢+ÙI]É¥Ñ ÀÌØí-äµÀìÌäíÑ¥ÙMÑÕÀQµÀ½±ÉÌÅÕ½Ðì°ÅÕ½ÐíMÑѱÌÀØØÜÅÕ½Ðì°ÅÕ½ÐíI}]=IÅÕ½Ðì°ÅÕ½ÐìÀÀÀÀÀÀÀÀÅÕ½ÐìÌäì¤ You are mixing ' and " here, without any reason. One tip: Do not mix them, stick to one type. Be it ' or " doesn't matter. Just dont mix them unless you need one of them as the content of a string. And for RegWrite you usually do not need both. To solve your problem, I suggest you remove all quotation marks (single and double) and then think where you set which ones. If you just want a solution without understanding the reason, on the first line remove all 3 quotations marks and start and end the string with ". On the second line replace the first ' with a " and delete the last '.
  14. I think you have a general misunderstanding of quotation marks in autoit. $Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\ This string is NOT terminated! Means you tell autoit to assign a string to a variable and "let autoit guess" where the string ends. Tell autoit exactly where the string ends, and it will work.
×
×
  • Create New...