From 7182502669544800d39ae5fca9bf3d3fc47d7c70 Mon Sep 17 00:00:00 2001 From: pt Date: Fri, 6 Mar 2020 00:33:24 -0500 Subject: [PATCH] list of parts to change not wrapped in an array if only one row --- TheBigOne.cls | 4 ++-- fpvt.frm | 14 +++++++++----- fpvt.frx | Bin 22552 -> 22552 bytes 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/TheBigOne.cls b/TheBigOne.cls index d5ac3ba..cb811a7 100644 --- a/TheBigOne.cls +++ b/TheBigOne.cls @@ -2188,7 +2188,7 @@ Public Function json_from_table(ByRef tbl() As Variant, ByRef array_label As Str End Function -Public Function json_from_table_zb(ByRef tbl() As Variant, ByRef array_label As String, Optional strip_braces As Boolean) As String +Public Function json_from_table_zb(ByRef tbl() As Variant, ByRef array_label As String, ByVal force_array As Boolean, Optional strip_braces As Boolean) As String Dim ajson As String @@ -2234,7 +2234,7 @@ Public Function json_from_table_zb(ByRef tbl() As Variant, ByRef array_label As 'if theres more the one record, include brackets for array 'if an array_label is given give the array a key and the array become the value 'then if the array is labeled with a key it should have braces unless specified otherwise - If r > 2 Then + If r > 2 Or force_array Then ajson = "[" & ajson & "]" If array_label <> "" Then ajson = """" & array_label & """:" & ajson diff --git a/fpvt.frm b/fpvt.frm index ce5fbeb..c65fd96 100644 --- a/fpvt.frm +++ b/fpvt.frm @@ -4,7 +4,7 @@ Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} fpvt ClientHeight = 8445.001 ClientLeft = 120 ClientTop = 465 - ClientWidth = 8940.001 + ClientWidth = 8805.001 OleObjectBlob = "fpvt.frx":0000 StartUpPosition = 1 'CenterOwner End @@ -230,7 +230,7 @@ Private Sub cbPLIST_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift vtable = x.ARRAYp_TransposeVar(vSwap) vtable = x.ARRAYp_zerobased_addheader(vtable, "original", "sales", "replace", "fit") vtable = x.ARRAYp_TransposeVar(vtable) - ptable = x.json_from_table_zb(vtable, "rows", False) + ptable = x.json_from_table_zb(vtable, "rows", True, False) Set jswap("swap") = JsonConverter.ParseJson(ptable) jswap("scenario")("version") = handler.plan @@ -270,7 +270,7 @@ Private Sub dbGETSWAP_Click() vtable = x.ARRAYp_TransposeVar(vSwap) vtable = x.ARRAYp_zerobased_addheader(vtable, "original", "sales", "replace", "fit") vtable = x.ARRAYp_TransposeVar(vtable) - ptable = x.json_from_table_zb(vtable, "rows", False) + ptable = x.json_from_table_zb(vtable, "rows", True, False) Set jswap("swap") = JsonConverter.ParseJson(ptable) jswap("scenario")("version") = handler.plan @@ -462,6 +462,10 @@ Private Sub opPlugVol_Click() End If End Sub +Private Sub pickSWAP_Change() + +End Sub + Private Sub sbpd_Change() tbpd.value = sbpd.value @@ -755,8 +759,8 @@ Private Sub UserForm_Activate() '--------reset swap tab------------------------------- lbSWAP.clear pickSWAP.value = "" - pickSWAP.text = "" - pickSWAP.list = Application.transpose(Worksheets("mdata").Range("F2:F1672")) + pickSWAP.text = Mid(sp("package")("basket")(1)("part_descr"), 1, 8) + pickSWAP.list = Application.transpose(Worksheets("mdata").Range("F2:F1112")) Call x.frmListBoxHeader(Me.lbSWAPH, Me.lbSWAP, "Original", "Sales", "Replacement", "Fit") '---------price volume radio button colors---------- diff --git a/fpvt.frx b/fpvt.frx index 6b821d65d5f2ff6748b59db7df2396d457a4d880..459f1149a9a97f84e50bffa8717950a1a96123f0 100644 GIT binary patch delta 1334 zcmZ8hZA@EL7(VCR+m2SCz(&A@uH`~Y2c;C&FB(ce0Mj;=kMdD)iL={CBq=nGVaTQo zb%r!E8uyquvS@TOQRA{qZ}f*c^^gA0CDSbaz$}ya(_|60Uuqn_m#)V2CVfxOd+vGO z=Y5{Hy>N|RxW;Q!u?ohf*?-UE$F+?@8jX*_DHNW=h!_xz;SCYw0o)Y+#(a*6M&_Uk zdd5}+kr9@DKgxGgD^*^$D#nX~fah{_>B6@HXE zHS8TZL+2S?JI~`qT?fUh6d8We*~Li)p-)Rx6d8R4U+e3LuJ*hyqo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