You are not logged in.
Hi,
I'm developing with Delphi 7 and I don't known how define the constant for this record. Can you help me?
type
TPosFlag = (pfInService, pfSupervisorHelp, pfReadyForCalls, pfMakingCall,
pfMakingCall2, pfReadyForChats, pfACDCall, pfACDChat, pfEnteringDigits);
TPosData = packed record
PosNumber: Word;
UserId: Word;
PosFlags: set of TPosFlag;
end;
const
__TPosData = 'PosNumber Word UserId Word PosFlags set of TPosFlag';
Thanks in advance.
Offline
What do you want?
- Declare a constant for this record :
TPosData = packed record
PosNumber: Word;
UserId: Word;
PosFlags: set of TPosFlag;
end;
const
POSTDATA : TPosData = (PosNumber : 10; UserID : 11; PosFlags : [pfInService]);
Offline
Hi Turrican.
I want pass to JSon.
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TPosData),
__TPosData).Options := [soReadIgnoreUnknownFields,soWriteHumanReadable];
Offline
Thanks Ab.
With this code fire the error: TJSONCustomParsers.Search(kind=6) not DynArray or Record.
type
TPosFlags = set of TPosFlag;
const
__TPosFlags = '(pfInService, pfSupervisorHelp, pfReadyForCalls, pfMakingCall, '+
'pfMakingCall2, pfReadyForChats, pfACDCall, pfACDChat, pfEnteringDigits)';
type
TPosData = packed record
PosNumber: Word;
UserId: Word;
PosFlags: TPosFlags;
end;
TACDPositions = array of TPosData;
const
__TPosData = 'PosNumber Word UserId Word PosFlags TPosFlag'
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TPosFlags),
__TPosFlags).Options := [soReadIgnoreUnknownFields,soWriteHumanReadable];
Offline
Many thanks AB, this work fine.
Offline