Hello,
I've had a heck of a time trying to add selections to the END of a list. It works great EXCEPT when I click on "Sacrum", "Extremity". OR "Pelvis"... when I click more than one of those it moves the other to the beginning of the list and I want to keep it at the end. Any help here would be appreciated! Here's the xdialog:
'begin code
dim a_vSpinList as C
dim vSpinList1 as c
dim vSpinList as c
a_vSpinList = <<%str%
c1
c2
c3
c4
c5
c6
c7
t1
t2
t3
t4
t5
t6
t7
t8
t9
t10
t11
t12
l1
l2
l3
l4
l5
Extremity
Sacrum
Pelvis
%str%
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Dysfunction",<<%dlg%
{Windowstyle=Gradient Horizontal}
{region}{font=Arial,13,b}
{sp=1}[%m;h;O={@@};C=14%.112,6vSpinList^#a_vSpinList]{watch=vSpinList!fooSpinList}
{endregion};
{region}
{color=Red on #254+254+235}{font=Tahoma,9}{sp=1}[%MW%.112,4vSpinDys2]{watch=vSpinDys2!fooSpinDysList}
{endregion};
{Region}{justify=center}{color=""}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion}
%dlg%,<<%code%
if a_dlg_button = "fooSpinList" then
a_dlg_button = ""
if vSpinList > "" then
vOldSpinList = VSpinlist1+vSPinList
vSpinListLast = word_unique(vOldSpinList, crlf() )
vSpinList1 = VSpinlist1+vSPinListLast
vNewSpinList = *remove_duplicatesi(vSpinList1)
'vSpinList1 = word_unique(VSpinlist1, crlf() )
vSpinList1 = *reverse_words(vNewSpinList, crlf())
a_dlg_button = ""
vSpinList2= case(line_count(vSpinList1)=1,crlf_to_comma(vSpinList1),line_count(vSpinList1)=2,strtran(crlf_to_comma(vSpinList1),","," and "),line_count(vSpinList1)>2,strtran(crlf_to_comma(*reverse_words("and "+*reverse_words(vSpinList1))),",",", "),.t.,"")
vSpinList2 = f_upper(vSpinList2)
vSpinDys2 = vSpinList2
vSpinList1 = ""
else
vSpinDys2 = ""
end if
end if
%code%)
'---end code
I've had a heck of a time trying to add selections to the END of a list. It works great EXCEPT when I click on "Sacrum", "Extremity". OR "Pelvis"... when I click more than one of those it moves the other to the beginning of the list and I want to keep it at the end. Any help here would be appreciated! Here's the xdialog:
'begin code
dim a_vSpinList as C
dim vSpinList1 as c
dim vSpinList as c
a_vSpinList = <<%str%
c1
c2
c3
c4
c5
c6
c7
t1
t2
t3
t4
t5
t6
t7
t8
t9
t10
t11
t12
l1
l2
l3
l4
l5
Extremity
Sacrum
Pelvis
%str%
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Dysfunction",<<%dlg%
{Windowstyle=Gradient Horizontal}
{region}{font=Arial,13,b}
{sp=1}[%m;h;O={@@};C=14%.112,6vSpinList^#a_vSpinList]{watch=vSpinList!fooSpinList}
{endregion};
{region}
{color=Red on #254+254+235}{font=Tahoma,9}{sp=1}[%MW%.112,4vSpinDys2]{watch=vSpinDys2!fooSpinDysList}
{endregion};
{Region}{justify=center}{color=""}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion}
%dlg%,<<%code%
if a_dlg_button = "fooSpinList" then
a_dlg_button = ""
if vSpinList > "" then
vOldSpinList = VSpinlist1+vSPinList
vSpinListLast = word_unique(vOldSpinList, crlf() )
vSpinList1 = VSpinlist1+vSPinListLast
vNewSpinList = *remove_duplicatesi(vSpinList1)
'vSpinList1 = word_unique(VSpinlist1, crlf() )
vSpinList1 = *reverse_words(vNewSpinList, crlf())
a_dlg_button = ""
vSpinList2= case(line_count(vSpinList1)=1,crlf_to_comma(vSpinList1),line_count(vSpinList1)=2,strtran(crlf_to_comma(vSpinList1),","," and "),line_count(vSpinList1)>2,strtran(crlf_to_comma(*reverse_words("and "+*reverse_words(vSpinList1))),",",", "),.t.,"")
vSpinList2 = f_upper(vSpinList2)
vSpinDys2 = vSpinList2
vSpinList1 = ""
else
vSpinDys2 = ""
end if
end if
%code%)
'---end code
Comment