boris.nihil
Members-
Content Count
21 -
Joined
-
Last visited
Community Reputation
0 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Does anybody have experience with 2d barcode, TurboPower SysTools, component StPDF417Barcode... I can't add StPDF417Barcode1.code = '...' witch contains some local letters (ŠĐČĆŽš), it says "Range check error"... virm_grad ,virm_adresa ,virm_naziv:string; virm_naziv := utf8encode('dsdddddd'); virm_adresa := utf8encode('ŠĐŠĐČĆĆČĆČ'); virm_grad := utf8encode('špšpUIZUZUZ'); StPDF417Barcode1.Code := 'HRVHUB30' + #13#10 + 'EUR' + #13#10 + virm_naziv + #10 + virm_adresa + #10 + virm_grad + #10;
-
all thanks goes to Remy
-
function GetValue(JsonObject: TJSONObject; const PairName: string): TJSONValue; var JsonPair: TJSONPair; begin JsonPair := JsonObject.Get(PairName); if JsonPair = nil then raise Exception.Create('Pair "' + PairName + '" not found'); Result := JsonPair.JsonValue; end; function GetObject(JsonObject: TJSONObject; const PairName: string): TJSONObject; begin Result := GetValue(JsonObject, PairName) as TJSONObject; end;
-
var JsonValueArr,JsonValue: TJSONValue; JsonObject: TJSONObject; jasonArr: TJSONArray; begin JsonValue := TJSONObject.ParseJSONValue(memoRequest.Lines.Text); if JsonValue = nil then begin ShowMessage('Error'); end else begin JsonObject := JsonValue as TJSONObject; JsonObject := GetObject(JsonObject, 'forretningsadresse'); jasonArr := GetValue(JsonObject, 'adresse') as TJSONArray; for JsonValueArr in jasonArr do begin showmessage(JsonValueArr.Value); end; end; end;
-
you are right, thanks for you help and your time
-
this works ok.. var jasonArr:TJSONArray; par: TJSONPair; i: Integer; LItem:TJSONValue; JsonValueArr : TJSONValue; testValue: TJSONValue; begin jasonArr := GetValue(JsonObject, 'documentStatus') as TJSONArray; for JsonValueArr in jasonArr do begin for LItem in TJSONArray(JsonValueArr) do begin if TJSONPair(LItem).JsonString.Value = 'statusCode' then odgovorFinaStatus.b2gStatus := TJSONPair(LItem).JsonValue.Value else if TJSONPair(LItem).JsonString.Value = 'statusText' then odgovorFinaStatus.b2gStatusTekst := TJSONPair(LItem).JsonValue.Value else if TJSONPair(LItem).JsonString.Value = 'statusTimestamp' then odgovorFinaStatus.b2gStatusVrijeme := TJSONPair(LItem).JsonValue.Value else if TJSONPair(LItem).JsonString.Value = 'note' then odgovorFinaStatus.b2gStatusNapomena := TJSONPair(LItem).JsonValue.Value else if TJSONPair(LItem).JsonString.Value = 'partialAmount' then begin try odgovorFinaStatus.b2gDjelIzn := StrToFloat(TJSONPair(LItem).JsonValue.Value); except odgovorFinaStatus.b2gDjelIzn := 0 end; end;
-
when i write for LItem in TJSONObject(JsonValueArr) do it says: [dcc32 Error] Unit1.pas(568): E2010 Incompatible types: 'TJSONValue' and 'TJSONPair'
-
something like this, seems to work: jasonArr := GetValue(JsonObject, 'documentStatus') as TJSONArray; for JsonValueArr in jasonArr do begin for LItem in TJSONArray(JsonValueArr) do begin ShowMessage(TJSONPair(LItem).JsonString.Value + '/' + TJSONPair(LItem).JsonValue.Value); end; end;
-
it works fine,thanks but now i have some array inside object how to acces this documentStatus element ? { "messageAck": { "messageID": "Middleware_002", "messageAckID": "a98d281b-9608-4b25-be03-7be0403916dd", "messageType": 9012, "ackStatus": "ACCEPTED", "ackStatusCode": 10, "ackStatusText": "Message received!" }, "b2GOutgoingInvoiceStatus": { "supplierID": "9934:86167814130", "additionalSupplierID": null, "invoiceID": 83703, "supplierInvoiceID": "IR-19-1766-1-1", "invoiceTimestamp": "28-02-2020", "documentStatus": [ { "statusCode": "RECEIVED", "statusText": "Received", "statusTimestamp": "28-02-2020", "note": null, "partialAmount": null} ] } }
-
uh, it's very complicated.. Thank a lot on your effort
-
you are right, from small to big picture i think this will do: JSonObject := TJSonObject.Create; JsonValue := JSonObject.ParseJSONValue(memoRequest.Lines.Text); JsonValue := (JsonValue as TJSONObject).Get('b2GOutgoingInvoiceEnvelope').JSONValue; JsonValue := (JsonValue as TJSONObject).Get('b2GOutgoingInvoiceProcessing').JSONValue; JsonValue := (JsonValue as TJSONObject).Get('correctB2GOutgoingInvoice').JSONValue; JsonValue := (JsonValue as TJSONObject).Get('invoiceID').JSONValue;
-
i can't figure out how to parse json answer from some invoice company I use Delphi XE4, DBXJSON... How to get Jsonpairs insde nested objects... Example: { "messageAck": { "messageID": "Middleware_002", "messageAckID": "8f50dd66-a77f-45ec-9049-0faadb69ff43", "messageType": 9002, "ackStatus": "ACCEPTED", "ackStatusCode": 10, "ackStatusText": "Poruka zaprimljena!" }, "b2GOutgoingInvoiceEnvelope": { "b2GOutgoingInvoiceProcessing": { "correctB2GOutgoingInvoice": {"supplierInvoiceID": "dokument1","invoiceID": 84001,"invoiceTimestamp": "03-03-2020"}, "incorrectB2GOutgoingInvoice": null}} }
-
Comunicate with POS terminal (Ingenico)
boris.nihil replied to boris.nihil's topic in Network, Cloud and Web
ok..thanks a lot for all the help!