problema com regedit (dados)

Delphi

21/11/2007

Como faço para saber se uma determinado valor de sequência está vazio...


Fiz vários testes, sempre entra na condição que existe valores.

var
  login : String;
begin
  reg := TRegistry.Create;
  with reg do
  begin
    RootKey := hkey_current_user;
    reg.OpenKey (´software\sp´, false);
    if reg.KeyExists(´teste´) then
    showmessage(´tem´);
  end;


testei com valuesExist KeyExist e outros.


Unix

Unix

Curtidas 0

Respostas

Vitor Alcantara

Vitor Alcantara

21/11/2007

var 
  login : String; 
begin 
  reg := TRegistry.Create; 
  with reg do 
  begin 
    RootKey := hkey_current_user; 
    reg.OpenKey (´software\sp´, false); 
    if reg.KeyExists(´teste´) then
    begin 
      if reg.ReadString(´teste´) = ´´ then
      ShowMessage(´String vazia´)
      else
      ShowMessage(´Valor existe: ´+ Reg.ReadString(´Teste´);      
    end
    else
    ShowMessage(´Valor não existe´);
  end;



GOSTEI 0
Unix

Unix

21/11/2007

Valeu Vitor, funcionou.


GOSTEI 0
POSTAR