Subject | Re: in new API |
---|---|
Author | Norbert Saint Georges |
Post date | 2018-06-09T15:01:59Z |
Norbert Saint Georges nsg@... [firebird-support] a écrit :
var
item : ansichar;
data: packed record
item: AnsiChar;
len: word;
case byte of
0: (vByte: Byte);
1: (vSmallint: Smallint);
2: (vInteger: Integer);
3: (dummy: array[0..5] of byte);
end;
fresult : integer;
begin
item :=ansichar(4);
tra.getInfo(st,1,@item,sizeof(data),@data);
if (data.item = item) then
case data.len of
0: ;
1: fresult := data.vByte;
2: fresult := data.vSmallint;
4: fresult := data.vInteger;
else
raise exception.Create('Unexpected data size.');
end else
raise exception.Create('Invalid item identifier.');
works very well.
--
Norbert Saint Georges
http://tetrasys.fi
>> transaction id (= current_transaction)ok, we erase everything and we take the sources of UIB.
>
> /* jrd\inf_pub.h
var
item : ansichar;
data: packed record
item: AnsiChar;
len: word;
case byte of
0: (vByte: Byte);
1: (vSmallint: Smallint);
2: (vInteger: Integer);
3: (dummy: array[0..5] of byte);
end;
fresult : integer;
begin
item :=ansichar(4);
tra.getInfo(st,1,@item,sizeof(data),@data);
if (data.item = item) then
case data.len of
0: ;
1: fresult := data.vByte;
2: fresult := data.vSmallint;
4: fresult := data.vInteger;
else
raise exception.Create('Unexpected data size.');
end else
raise exception.Create('Invalid item identifier.');
works very well.
--
Norbert Saint Georges
http://tetrasys.fi