Fórum problema com regedit (dados) #349348

21/11/2007

0

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

Responder

Posts

21/11/2007

Vitor Alcantara

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;



Responder

Gostei + 0

21/11/2007

Unix

Valeu Vitor, funcionou.


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar