w0uter Posted July 9, 2005 Share Posted July 9, 2005 (edited) gets the current PID and stores it in the macro @PID. dim $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId') Assign("@PID", $ai_GetCurrentProcessId[0], 2) $ai_GetCurrentProcessId = '' also i was wondering if i could DELETE the variable ($ai_GetCurrentProcessId) COMPLETELY. Edited July 9, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
LxP Posted July 9, 2005 Share Posted July 9, 2005 also i was wondering if i could DELETE the variable ($ai_GetCurrentProcessId) COMPLETELY.You could put those lines into a function and declare the variable locally; the variable then wouldn't exist after the end of the function. This is what I do when I don't want a bunch of useless variables hanging around.Just out of interest, why would you want to completely remove the variable? I'm guessing for memory reasons perhaps but I can't imagine that a variable would take up all that much memory. Link to comment Share on other sites More sharing options...
w0uter Posted July 9, 2005 Author Share Posted July 9, 2005 if someone would use this. and wanted to use IsDeclared(). it would come up as 1. i want it to come out as 0 so the only remains of my snippet are @PID. i tried storing the array from DLL call in @PID first. but autoIt cant handle array-macro's. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
LxP Posted July 9, 2005 Share Posted July 9, 2005 if someone would use this. and wanted to use IsDeclared(). it would come up as 1. i want it to come out as 0 so the only remains of my snippet are @PID.I see what you mean now and understand why the idea of a function to remove variables from memory seems good; it probably would be better coding practice not to handle a variable that way though. Functions not only offer the ability to prevent unnecessary variables from remaining in memory but they also guarantee that if the caller of the function has a variable of the same name, it won't be destroyed. In my opinion a method to remove variables in this way could be likened to the dreaded GOTO instruction -- there are other ways to achieve the same effect and they are much more intuitive. Link to comment Share on other sites More sharing options...
FuryCell Posted July 9, 2005 Share Posted July 9, 2005 Cool. I think you should change the macro name to somthing more descriptive like @AutoItPID though. You should put a post in the idea lab for this to be added as a built in macro as it is a very useful one because it is needed in certain DllCalls(). HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
Valik Posted July 9, 2005 Share Posted July 9, 2005 w0uter, the fact that you can use Assign() in this manner is a bug and will be fixed. I was trying to wait until I had made some other changes to Assign() before introducing the fix, but I see now that people want to try to exploit the bug so it'll be fixed within the next version or two with the rest of the changes coming later. I do agree that the PID should be available as a macro, though. Link to comment Share on other sites More sharing options...
blindwig Posted July 9, 2005 Share Posted July 9, 2005 Cool. I think you should change the macro name to somthing more descriptive like @AutoItPID though. You should put a post in the idea lab for this to be added as a built in macro as it is a very useful one because it is needed in certain DllCalls().<{POST_SNAPBACK}>How about @ScriptPID, to go with the convention of @ScriptName, @ScriptDir, etc My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
FuryCell Posted July 9, 2005 Share Posted July 9, 2005 How about @ScriptPID, to go with the convention of @ScriptName, @ScriptDir, etc<{POST_SNAPBACK}>That sounds good too but I thought @AutoItPID is better because it goes with @AutoItEXE and if the script is not compiled it will not be the PID of the script (as it would not have one.) but actually the PID of AutoIt3.exe HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
w0uter Posted July 9, 2005 Author Share Posted July 9, 2005 w0uter, the fact that you can use Assign() in this manner is a bug and will be fixed. I was trying to wait until I had made some other changes to Assign() before introducing the fix, but I see now that people want to try to exploit the bug so it'll be fixed within the next version or two with the rest of the changes coming later.I do agree that the PID should be available as a macro, though.<{POST_SNAPBACK}>aww cant you just see this as an "unintended" functionality,like as an array in an array ? and keep it ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Valik Posted July 9, 2005 Share Posted July 9, 2005 aww cant you just see this as an "unintended" functionality,like as an array in an array ? and keep it ?<{POST_SNAPBACK}>No. Link to comment Share on other sites More sharing options...
layer Posted July 9, 2005 Share Posted July 9, 2005 Oh yea, I remeber talk of the Assign exploit, can't remeber where ... FootbaG Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now