omi Posted August 6, 2008 Posted August 6, 2008 I want to make some variables as gobal and access them in some another file for that i want to make it extern. how can i make that. Thnaks in advance.
amokoura Posted August 6, 2008 Posted August 6, 2008 Please specify more, I don't understand. "File"? "Extern"?
Glyph Posted August 6, 2008 Posted August 6, 2008 save to an ini file??? then have the other file read that? tolle indicium
MilesAhead Posted August 6, 2008 Posted August 6, 2008 I want to make some variables as gobal and access them in some another file for that i want to make it extern. how can i make that.Thnaks in advance.I don't think you can declare variables so that they are accessible outside the file. What you can do is simulate a "Property" as used in other languages like C++ C# and Delphi. Use functions in a file that set and retrieve the state of a variable and include the file in your script. For example if your "extern" variable would be a color value you might want to have $MyColor accessible from all scripts using your routines. So you would need a function or functions to set and return its value like SetMyColor GetMyColor etc..Not sure about .dll libraries and AutoIt3 though. COM has properties also. My Freeware Page
omi Posted August 7, 2008 Author Posted August 7, 2008 I don't think you can declare variables so that they are accessible outside the file. What you can do is simulate a "Property" as used in other languages like C++ C# and Delphi. Use functions in a file that set and retrieve the state of a variable and include the file in your script. For example if your "extern" variable would be a color value you might want to have $MyColor accessible from all scripts using your routines. So you would need a function or functions to set and return its value like SetMyColor GetMyColor etc..Not sure about .dll libraries and AutoIt3 though. COM has properties also.Thank you very much for your help!!
MilesAhead Posted August 7, 2008 Posted August 7, 2008 Thank you very much for your help!!Sure thing. If you find out any more details I'd appreciate a heads up. I'm not sure exactly how AutoIt handles variables. For instance in C or C++ you can have a "static" variable inside a function that doesn't go away when the function returns... and use that to store the value of Get/Set functions(at least in C, in C++ you'd just use a private or protected member variable but C doesn't have classes so you improvise.) I'm not sure exactly how to approach it in AutoIt but if you mess around with it you'll probably find out the exact mechanism. Esp. if you have any kind of access from multiple places where the order of execution is not definite(like threads or some kind of cooperative multi-tasking functions or something) you'd want to serialize access to the variable. My Freeware Page
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