Subject Re: Array
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Mon, 8 Mar 2021 05:41:30 -0800
Newsgroups dbase.getting-started

On 3/7/2021 11:24 PM, Rob Rickard wrote:
> Hi All
> can somebody please advise which is the best solution to use.
> Append from array OR extract out of a txt file.
> i need to get information out of this array
>
> [{"Id":2773,"Date":"2021-03-08T00:00:00+11:00","StartTime":1615147200,"EndTime":1615183200,"Mealbreak":"2021-03-08T00:30:00+11:00","Slots":[{"blnEmptySlot":false,"strType":"B","intStart":0,"intEnd":1800,"intUnixStart":1615147200,"intUnixEnd":1615149000,"mixedActivity":{"intState":3,"blnCanStartEarly":1,"blnCanEndEarly":1,"blnIsMandatory":1,"strBreakType":"M"},"strTypeName":"Echo","strState":"Scheduled Duration"}],"TotalTime":9.5,"Cost":0,"OperationalUnit":21,"Employee":0,"Comment":"Note: All shift Finish times are nominal and should not be viewed as an expected finish time. For all entitlements please refer to the EBA","Warning":"","WarningOverrideComment":"","Published":false,"MatchedByTimesheet":0,"Open":false,"ApprovalRequired":false,"ConfirmStatus":0,"ConfirmComment":"","ConfirmBy":0,"ConfirmTime":0,"SwapStatus":0,"SwapManageBy":null,"ShiftTemplate":1,"ConnectStatus":null,"Creator":1,"Created":"2021-03-04T10:29:28+11:00","Modified":"2021-03-04T10:30:21+11:00","OnCost":0,"StartTimeLocalized":"2021-03-08T07:00:00+11:00","EndTimeLocalized":"2021-03-08T17:00:00+11:00","ExternalId":null,"ConnectCreator":null,"BidsCount":null},{"Id":2774,"Date":"2021-03-08T00:00:00+11:00","StartTime":1615147200,"EndTime":1615183200,"Mealbreak":"2021-03-08T00:30:00+11:00","Slots":[{"blnEmptySlot":false,"strType":"B","intStart":0,"intEnd":1800,"intUnixStart":1615147200,"intUnixEnd":1615149000,"mixedActivity":{"intState":3,"blnCanStartEarly":1,"blnCanEndEarly":1,"blnIsMandatory":1,"strBreakType":"M"},"strTypeName":"Echo","strState":"Scheduled Duration"}],"TotalTime":9.5,"Cost":0,"OperationalUnit":44,"Employee":0,"Comment":"Note: All shift Finish times are nominal and should not be viewed as an expected finish time. For all entitlements please refer to the EBA","Warning":"","WarningOverrideComment":"","Published":false,"MatchedByTimesheet":0,"Open":false,"ApprovalRequired":false,"ConfirmStatus":0,"ConfirmComment":"","ConfirmBy":0,"ConfirmTime":0,"SwapStatus":0,"SwapManageBy":null,"ShiftTemplate":1,"ConnectStatus":null,"Creator":1,"Created":"2021-03-04T10:30:27+11:00","Modified":"2021-03-04T10:30:57+11:00","OnCost":0,"StartTimeLocalized":"2021-03-08T07:00:00+11:00","EndTimeLocalized":"2021-03-08T17:00:00+11:00","ExternalId":null,"ConnectCreator":null,"BidsCount":null},{"Id":2775,"
>
> i have included the start of the 2nd shift - there are multiple shifts to deal with
> i do not need all the information only parts of it. eg Id, Date, starttime, finishtime, Employee
> i have never done anything with append from array so any help and suggestions would be greatly appreciated. i have saved the output to a txt file with no problems.so ....

This looks, at a glance, like it might be JSON data. If so, and you are
using recent versions of dBASE, there is a JSON object (discussed in The
dBASE Book Plus, version 3, in some detail) ... if it's not JSON, well
you're probably going to have to parse it with code written specifically
for that format. But it does look like standard name/value pairs and so on.

Ken

--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm