Application Creation\Variables Questions
I am a systems administrator and I collected a lot of tools\scripts for working on systems and I have been thinking of trying to make an application for quickly running them and making it easy to collect output.
I don't really have any programming experience but I've done a bit of batch\vbs scripting for login scripts and unattended setup disks. I've also installed php scripts with mysql databases as well. I thought of mmf2 because I did play with The Games Factory when I was in high school for making some simple games some when I was younger and liked it.
It doesn't seem like mmf2 supports windows environment variables though. I figured out how to use the file object and alterable strings to get some of the system paths I would like to use, but is there a way to get the equivalent of %programfiles% and is there an equivalent for variables like %username% and %computername%. Is there a list of all of the variables you can use with MMF2 expressions somewhere? One work around I was thinking of is executing a script from my app that runs a replace tool and outputs these variables to an ini file. Than I should be able to load these variables into an alterable strings using the ini functions correct?
I want to be able to check for installed programs at their default installation paths and return results even if the os isn't installed on the C: drive. I also want to be able to save files with the computer name and maybe even the username in the file name. I could probably just the app to execute scripts for what I want, but I want to do as much from within the application as I can.
I would also like to know how I can have a timer that displays how long the app has been open and works across multiple frames.
The end goals is too have a tool that desktop analysts can use to quickly install apps\registry patches that we have listed on our new user/pc checklists, record the data, let them ftp the output files to an ftp server at the office, and maybe even save some of the info to a mysql database. It would be great if it could also save the time the app opened and closed to an output file or database. I had looked at some of the online high score tutorials and was thinking it would be great if the desktop analysts could work on a pc and upload data showing their start and stop times and output file showing that the apps have been installed, and the engineers/managers could go to a web site and view the data.
It looks like MMF2 with extensions can do most if not all of what I want. Would I need the developer version for any reason to accomplish what I want. I don't mind the runtime agreeemant, but I was just wondering if any of the objects that come with the developer version would be particularly useful for creating the kind of app I want to make. If I do need to run scripts for most of what I want to do, is there a way to run them from some type of archive or build them into the executable; so that I don't have to have a sub folder full of scripts that everyone can look thru?
Re: Application Creation\Variables Questions
I have no idea what you just said.
Re: Application Creation\Variables Questions
There is an OS extension in MMF2 Developer that allows you to easily retrieve the enviromental variables.
I might have some more comments on some of your other questions in a bit - I need to digest and break them down so I can reply completely. You have a lot going on :)
Re: Application Creation\Variables Questions
Thanks, the OS extension is probably exactly what I need. Now is there a good tutorial that explains making if statements and calling external programs. If I tell an mmf2 app to execute an external script will my app immediately move on to the next event line or will it wait for the script to finish running? Is there a way to tell it to wait for a certain amount of time, or until the script is closed before moving onto the next event line? I've also noticed playing with some of the extensions that some ask you if you want to make the object global, what exactly does that mean? Does that mean it is available for all of frames, and can I make any object global?
I would also still like to know what in mmf is the best thing to use for variables? Should I use alterable strings?, is there a way to change global strings?
Edit: I tried out the OS extension and I was able to get the computername with it. Can anyone tell me how to use the environment variable function of this object to retrieve other values. I have vbscripts that create environment variables and set them to certain paths if the path exists or leaves it as null if it does not. I would like to be able to have my application do different functions based on whether or not these variables or set to null.
Re: Application Creation\Variables Questions
Quote:
If I tell an mmf2 app to execute an external script will my app immediately move on to the next event line or will it wait for the script to finish running? Is there a way to tell it to wait for a certain amount of time, or until the script is closed before moving onto the next event line?
Well there is an option to do either, you first tell MMF to execute an external application, you do this in the event editor under the Special Conditions column. After you specify the external application to execute there will be check boxes asking if you want to "wait for end" and "hide the application"
If you check "wait for end" the program will stop right there and wait for the other application to finish, then it will resume from where it left off in the code, and I'm assuming this is what you want.
Quote:
I've also noticed playing with some of the extensions that some ask you if you want to make the object global, what exactly does that mean?
That will allow you to use the object from any frame, for example if you want to use the YASO object in your program on every frame you can make it global instead of making a new one for every frame, it does other things but that the main thing its used for.
Quote:
I would also still like to know what in mmf is the best thing to use for variables? Should I use alterable strings?, is there a way to change global strings?
It depends on whether or not you will need it for every frame or just the frame your working with, for example if you need to keep data about a file path temporally you can use the sting object in hidden mode to store it, but if you need that data for the whole application you store it in a global string, and yes global strings can be changed at runtime using the Special conditions column.
Quote:
I tried out the OS extension and I was able to get the computername with it. Can anyone tell me how to use the environment variable function of this object to retrieve other values.
You can use a combination of the YASO and the file object to get environment variables.
I made you an example to show you how here:
http://www.jsoftgames.com/systemex.zip
Re: Application Creation\Variables Questions
Thank you, your example helped me out a lot.
I figured global objects are for using throughout multiple frames. I guess my real question is how do I know if an object is global or not and how do I change it. Can all objects be set to global or does the object your working with have to support it? You mentioned making yaso global; how can I check it in your example to see if it is currently set to global or not and how do I change the current setting?
Can Yaso or the OS object get custom environment variables. For example say my installer goes into the registry and creates a permanent variable called %modules% that is set to a certain path. How can I check that variable with my application?
Re: Application Creation\Variables Questions
Sorry about my earlier comment about making the YASO object global, its not possible, i just used it as an example without actually checking it. No its not possible to use the YASO object a global object, and you don't need to it doesn't have changeable values like active objects and such. Sorry about confusing you like that. I'll double check before I say something next time.
You can check if somethings global or not by clicking on the object, then the "Runtime Options" tab in the Properties window, there will be a check box to make an object global if its possible for that object.
And About environment variables, at this time I don't think there is an extension to retrieve those directly, if you want to store strings and paths for later retrieval you can use the ini object to store the path or sting in a file. If you must use environment variables you can use the registry object to retrieve the variables manually and store them in string objects or global strings. I have made an example file to show you how, please note however that this example only uses a certain part of the registry and doesn't actually retrieve environment variables correctly, but I think it'll do the job.
http://www.jsoftgames.com/enviromentvar.zip