Skip to content

Commit 590d7c0

Browse files
committed
update masterdetailtojson()
1 parent 5eeec05 commit 590d7c0

6 files changed

Lines changed: 12 additions & 6 deletions

File tree

JSONFox.PJT

99 Bytes
Binary file not shown.

JSONFox.pjx

0 Bytes
Binary file not shown.

jsonfox.app

85 Bytes
Binary file not shown.

src/cursortojsonobject.prg

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ define class CursorToJsonObject as session
3131
Function MasterDetailToJSON(tcMaster as String, tcDetail as String, tcExpr as String, tcDetailAttribute as String, tnSessionID as Integer) as Object
3232
if !empty(tnSessionID)
3333
set datasession to tnSessionID
34-
EndIf
35-
Local laArray, loRow, lnRecno, lbContinue, laDetail, lcMacro, lcCursor
34+
ENDIF
35+
36+
Local laArray, loRow, lnRecno, lbContinue, laDetail, lcMacro, lcCursor,i
3637
laArray = createobject("TParserInternalArray")
3738
** Set Detail cursor
3839
this.nSessionID = tnSessionID
3940

4041
select (tcMaster)
4142
lnRecno = Recno()
42-
Scan
43+
i = 0
44+
scan
45+
i = i + 1
4346
Scatter memo name loRow
4447
laDetail = .null.
4548
* Filter detail
@@ -77,7 +80,10 @@ define class CursorToJsonObject as session
7780
Go lnRecno in (tcMaster)
7881
Catch
7982
EndTry
80-
81-
return @laArray.getArray()
83+
IF i>0
84+
return @laArray.getArray()
85+
ELSE
86+
RETURN .null.
87+
ENDIF
8288
EndFunc
8389
enddefine

src/frmjsonviewer.scx

0 Bytes
Binary file not shown.

src/jsonclass.prg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ define class JSONClass as session
44
LastErrorText = ""
55
lError = .f.
66
lShowErrors = .t.
7-
version = "9.25"
7+
version = "9.26"
88
hidden lInternal
99
hidden lTablePrompt
1010
Dimension aCustomArray[1]

0 commit comments

Comments
 (0)