- Stewart MacPherson
- PowerBuilder
- Friday, 2 December 2022 01:47 PM UTC
Hello,
We are developing in PowerBuilder 12.5 and I'm looking to find the best way to create a Json file format. Currently we are writing the data using a function out to a text file, Is there any way in PB 12.5 to create a json file with the format below? I can change the .txt to .json but it's not in the format below with the quotes etc.. Any help would be greatly appreciated.
example how we want it to look
{"OriginJurisdiction":"YT","ControlNumber":"000202009","VersionNo":"000","SentCount":28339,"FileTime":"2020-09-04T00:05:39"}
our current coding
ls_filename15 = "PE15" + ls_transmit_to + "recap.json"
ls_15_rec = "TransactionId" +":" + " " + ls_transtype + " " + "Vin" +":" + " " + ls_vin + " " + "Make" + ":" + ls_veh_make
//write the 15 record to the file
ls_full_filename = ls_path + ls_filename15
li_file15 = FileOpen(ls_full_filename, LineMode!, Write!, LockWrite!, Append!)
FileWrite(li_file15, ls_15_rec)
FileClose(li_file15)
Thanks
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.