Ultima modifica:
Devo verificare la presenza della scheda audio quindi non mi serve la qualità ma solo una risposta SI o NO ho usato questo codice:
Ma mi restituisce l'errore:
[DCC Error] Unit1.pas(138): E2010 Incompatible types: 'string' and 'Boolean'
Sulla Riga:
myStringList.Add((IsSoundCardInstalled));
Risolto:
Codice:
function IsSoundCardInstalled: Boolean;
Begin
Result := waveOutGetNumDevs > 0;
End;
procedure TForm1.FormCreate(Sender: TObject);
var
ids: TidIpWatch;
Speed: Double;
myStringList: TStringList;
begin
ids := TidIpWatch.Create;
Speed := GetCPUSpeed;
ids.Free;
myStringList:=TStringList.Create;
myStringList.Add('IP:' + (ids.LocalIP));
myStringList.Add('CPU: ' + (Tipo_cpu) + ' ' + Format('%f', [Speed]));
myStringList.Add((IsSoundCardInstalled));
myStringList.Add('etc.');
Memo1.Lines.Assign(myStringList);
myStringList.Free;
end;
Ma mi restituisce l'errore:
[DCC Error] Unit1.pas(138): E2010 Incompatible types: 'string' and 'Boolean'
Sulla Riga:
myStringList.Add((IsSoundCardInstalled));
Messaggio unito automaticamente:
Risolto:
Codice:
procedure TForm1.FormCreate(Sender: TObject);
var
Speed: Double;
myStringList: TStringList;
begin
Speed := GetCPUSpeed;
myStringList:=TStringList.Create;
TIdStack.IncUsage;
try
myStringList.Add('IP: ' + GStack.LocalAddress);
finally
TIdStack.DecUsage;
end;
myStringList.Add('SO: '+(InfoSO));
myStringList.Add('CPU: '+(Tipo_cpu) + ' ' + Format('%f', [Speed]));
myStringList.Add('Scheda Audio: '+BoolToStr(IsSoundCardInstalled));
myStringList.Add('Etc');
Memo1.Lines.Assign(myStringList);
myStringList.Free;
end;