PDA

View Full Version : Extracting Registry info from a txt file


Mat
12-16-2003, 03:23 AM
Hello there,

I wonder if it's possible to extract information out of a mere txt file.
How do I make my cd-browser read a text file and use the information to check my registry for certain entries?

I bet there's a way to do that. ;)

Thanks!

Mat

Brett
12-16-2003, 07:26 AM
Look in the Help file for actions that start with TextFile, String and Registry...

There are plenty of actions to do what you want. The implementation is really up to you and the task at hand. Try getting in and fooling around with some of those actions and let us know where you get stuck.

Mat
12-16-2003, 07:48 AM
Well, at the moment I'm checking all registry information I need with a huge bunch of code within media studio. So, every time our customer changes a directory I have to open every project concerned and change the code and build. So, instead of doing that, there could be a txt file loaded with that code which can be changed easily.

Brett
12-16-2003, 08:00 AM
Shouldn't be a problem. Again, I can't really offer you more than that until you ask a specific question.

Mat
01-07-2004, 09:59 AM
Well, let's say there's a button that causes a mere dialog to pop up, like:

result = Dialog.Message("Notice", "Your message here.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

and I don't want this code to appear inside AutoPlay but inside a txt file located anywhere so it can be changed easily without touching AutoPlay. How do I get this read out?

Brett
01-07-2004, 10:13 AM
In that case I would use an INI file:

[Messages]
DialogTitle=Notice
DialogText=Your message here.

Then use the INI file actions to read the strings and use them in your code:

strTitle = INIFile.GetValue("C:\\Temp\\MyIni.ini","Messages","DialogTitle");
strMessage = INIFile.GetValue("C:\\Temp\\MyIni.ini","Messages","DialogText");

Dialog.Message(strTitle,strMessage);

Mat
01-07-2004, 10:18 AM
Cool, that works fine! Thanks! :)

Now I'll just have to make it read out the registry... ;)
Thanks for your help!

Mat
01-07-2004, 10:35 AM
Okay, another point: Is it possible to import all functions I set for a button from a txt or ini file (or whatever)? So all I got inside the OnClick Action field is a function that gets me all info out of a external file...

Is that confusing? :confused:

Stefan_M
01-07-2004, 02:10 PM
Hi,

take a look at the help file and go to
Scripting guide / Other Built in Functions

maybe the "dofile" action does what you want.

Stefan