in specific cases i’m writing a ‘null guid’ into a TGuidField
const cGFDNullGuid :TGuid = ‘{00000000-0000-0000-0000-000000000000}’;
i’m assigning it using
property gst_SGUID: TGuid read Getgst_SGUIDValue write Setgst_SGUIDValue;
of the strongly typed interface
now applyupdates says it can’t stream an invalid guid:.
when debugging
procedure Bin2_WriteGUIDToStream(Stream: TStream; const Value: string);
the value is ‘’, an empty string?
procedure TStringField.SetAsGuid(const Value: TGUID);
begin
if Value = GUID_NULL then
SetAsString('')
else
SetAsString(Value.ToString);
end;
function TStringField.GetAsGuid: TGUID;
var
S: string;
begin
S := GetAsString;
if S <> '' then
Result := StringToGuid(S)
else
Result := GUID_NULL;
end;
workaround: pls update uDAFields.pas as
const EmptyGUID_String = '{00000000-0000-0000-0000-000000000000}'; //added
function TDACustomField.GetValue: Variant;
..
{$IFDEF DELPHI_TOKYO_UP} // added
if (DataType = datGuid) then Result := GetAsVariant else // added
{$ENDIF} // added
result := fField.Value;
..
function TDACustomField.GetAsString: string;
..
Result:= inherited GetAsString;
{$IFDEF DELPHI_TOKYO_UP} //added
if (DataType = datGuid) and (Result = '') then Result := EmptyGUID_String; //added
{$ENDIF} //added
...
function TDACustomField.GetAsVariant: variant;
..
Result:= inherited GetAsVariant;
{$IFDEF DELPHI_TOKYO_UP} //added
if (DataType = datGuid) and (VarToStr(Result) = '') then //added
Result := EmptyGUID_String; //added
{$ENDIF} //added
will this be in future releases of DA or not?
(evaluating if we need to pursue some other strategy or not since emb has changes this)
(will ask why they changed this)