Модератор: Модераторы
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.5.1 PHP/5.2.4-2ubuntu5.4 with Suhosin-Patch Server at bugs.freepascal.org Port 80</address>
</body></html>
Подключение к узлу утеряно.
if AVariant = Unassigned then Exit;
procedure TForm1.Button1Click(Sender: TObject);
var
v: Variant;
begin
v := VarArrayCreate([0, 1, 0, 2], varvariant);
if v = Unassigned then
ShowMessage('Unassigned')
else
ShowMessage('Assigned');
end;
program variant_test;
uses variants;
var
v: Variant;
begin
v := VarArrayCreate([0, 1, 0, 2], varvariant);
if v = Unassigned then
writeln('Unassigned')
else
writeln('Assigned');
end.
program variant_test;
uses variants;
var
v: Variant;
begin
v := VarArrayCreate([0, 1, 0, 2], varvariant);
if v[0,0] = Unassigned then
writeln('Unassigned')
else
writeln('Assigned');
end.
program variant_test;
uses variants;
var
v: Variant;
begin
//v := VarArrayCreate([0, 1, 0, 2], varvariant);
if v[0,0] = Unassigned then
writeln('Unassigned')
else
writeln('Assigned');
end.
yuray писал(а):Как мне проверить значение переменной variant наперед не зная ее тип?
program variant_test;
uses variants;
var
v: Variant;
begin
v := VarArrayCreate([0, 1, 0, 2], varvariant);
if VarIsArray(v) then
writeln('Assigned')
else
begin
if v = Unassigned then
writeln('Unassigned')
else
writeln('Assigned');
end;
end.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 19