April 24, 2024, 07:37:01 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


.REG and .TXT files

Started by JoaoAfonso, December 11, 2008, 10:40:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JoaoAfonso

Good evening.
I have a simple question to make: I exported a portion of my registry to a file, with the extention .txt. If I open using notepad, it works as supposed, but when I try to open in an EB program using openfile and read, it just shows strange characters.
Are .reg files not simple text files? Do I need any kind of converter, or there is any trick I do not know?

On the other hand, trying to work abit with the registry commands implemented in EB, figured out that eventually it would be very useful a findopen/findnext commands to work with registry tree. Checked also that RegEnumKey can do it, but I still cannot understand how to "convert" functions from other languages to EB... But again, is there anything implemented in EB that can check all registry subkeys from a given key?

Thanks in advance
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Ionic Wind Support Team

As for the first question...pretty sure they are standard text files, and also I am sure I've used the Emergence "editor.eba" program to read one once.  So i would need to see the code you were trying to use, my psychic powers aren't what they used to be.

The registry commands I included were meant for common tasks such as creating keys, retrieving values and deleting keys.  For anything more advance you can use the API functions relatively easily in Emergence.  Post what you are trying to do.

Paul.

Ionic Wind Support Team

sapero

December 12, 2008, 04:32:59 AM #2 Last Edit: December 12, 2008, 04:34:40 AM by sapero
The .reg and .txt files are by default saved in unicode character set. You can detect it by comparing the first two characters with \xFF \xFE.

__read(file, bufer, size)
if (*<word>bufer = 0xFEFF)
*<string>buffer = w2s(*<wstring>(buffer+2))
size = (size - 2) / 2
endif

Ionic Wind Support Team

Nice catch Sapero.  The last time I looked at a .reg file was under Win 98, and they were in ANSI.   Why Microsoft decided to change the export to unicode I will never understand, all it does on my machine is increase the exported file size by 2 ::)

Paul.



Ionic Wind Support Team

JoaoAfonso

Good evning.
Basically I was working using this "old" inc file from IB Pro archive. As I couldn't get the whole registry tree using these subroutines, I tried the following:
SYSTEM "regedit" , "/e c:\\um.txt HKEY_CURRENT_USER\\Software
and then tried to, using openfile and closefile, read "um.txt"... But always returned strange chars in spite of plain text.

I was trying to learn abit more about EB reading IB Pro archive code files, and the other day experiments were about cookies and registries :)
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900