Re: Passenger Seating Dbase
Ray,
this is the function absent the excess junk and added are some msgbox() for debugging. Replace the old one and see if this works to help figure out where the rub is.
Ray,
this is the function absent the excess junk and added are some msgbox() for debugging. Replace the old one and see if this works to help figure out where the rub is.
Code:
FUNCTION Navigator AS C ( ) 'set form to View Mode topparent.cancel() topparent.commit() 'Establish variables Dim global vcFfrom as C dim global vnavT as C dim global vcFnavTo as C vnavT = "" vcFfrom = a_form_current msgbox("current form",vcFfrom) ' check to assure this form is in the Nav_forms table if tablecount("nav_forms","form_name = "+quote(vcFfrom))=0 message_wave() p_msg_box("ALERT","The current form: " +UT(alltrim(vcFfrom)) + " is not found in the Nav_Forms table. table. *","<OK>","") end end if 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ' generate the forms list from the nav_forms table dim vL1 as C dim vL2 as C dim vFlist as C dim vFenum as N vL1 = table.external_record_content_get("nav_forms","alltrim(nav_name)","f_order","") vL2 = table.external_record_content_get("nav_forms","alltrim(form_name)","f_order","") vflist = *for_each(foo,foo+"!"+word(vL2,*counter(),crlf()),vL1) ' the "!" generates the button return vflist = vflist + "Cancel!cancel" msgbox("the nav_form list content", vflist) ' process out the current form vflist = *line_remove(vflist,word_number_get(vflist,vcFfrom,crlf())) vFenum = w_count(vflist,crlf()) - 1 msgbox("Count = " + vFenum, "New list absent current form: " +crlf()+vflist) ' generate the form list as codes for dialog buttons dim vdlg_list as C="" dim vFW as C dim vcycle as N = 0 for each foo in vflist vFW = alltrim(foo.value) vcycle = vcycle + 1 if vcycle = vFenum + 1 vdlg_list = vdlg_list + "{lf};" + crlf() + "<20" + vFW + "> " + crlf() + "{endregion};" else vdlg_list = vdlg_list + "{region}" + crlf() + "<20" + vFW + "> " + crlf() + "{endregion};" + crlf() end if next msgbox("xdialog construct", vdlg_list) ' generate the dialog dim z1 as C dim z2 as C dim vdlgF as C dim vresults as C dim vOpenT as L=.f. z1 = <<%dg1% {background=#135,155,150} {nocaption} {justify=center} {position=11.5,1} {ymargin=1,1} {xmargin=1,1} Keep Current Open; (vOpenT); {frame=1,%dg1% z1b = <<%dg1b% {region} {endregion}; {lf};%dg1b% z2 = <<%dg2% {region} {endregion}; %dg2% vdlgF = z1 + (""+vFenum + "}") + (""+vdlg_list) + z2 vresult = ui_dlg_box("Navigator",vdlgF) select case vresult="cancel" end case vresult = "F_Help" vOpenT = .t. end select ' convert the dialog output variable to the navigation variable vcFnavTo = vresult 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ' close current form or browse window dependant on the dialog checkbox vOpenT value. if vOpenT = .f. DIM window_to_close as C window_to_close = Var->vcFfrom DIM varP_Window as p 'Get a pointer to the specified window varP_Window = obj(window_to_close) 'Close the window varP_window.close(.f.) end if 'Open the Selected Form DIM Shared varP_Var->ncFnav as P DIM layout_name as C layout_name = Var->vcFnavTo Getform = Var->vcFnavTo DIM tempP as p 'Get pointer to existing window. In case layout_name is qualified with a dictionary name, extract up to first @. In case formname has spaces, normalize it tempP=obj(":"+object_Name_normalize(word(layout_name,1,"@"))) 'Test if pointer is valid if is_object(tempP) then 'Test if pointer refers to a form or browse if tempP.class() = "form" .or. tempP.class() = "browse" then 'If so, then activate the already open window tempP.activate() else 'Window is not already open, so open it :Form.view(layout_name) end if else :Form.view(layout_name) end if END FUNCTION
Comment