Hi All,
Not being a big fan of ask variables, I typically just use one screen to get all the parameters I need for a printing from a list of reports/letters. In doing so, different layouts may prompt differently for date variables (e.g. "Date on Letter" vs "Service Start Date"). In the script below you will see that when you change the report selection the date prompts will change in wording as well as availability.
Problem:
When I select a report type by use of a mouse click all works fine. However, when I use the up & down arrows to navigate up and down the list, the choice number (nChoice) is thrown off. Is this a bug of V5? For testing purposes I added the choice number as a character just below the radio buttons. Since this script is not tied to a table or set, it can be run directly with no further downloads.
Does it behave this way for other users? If so, is there a way to disable the up/down keys while in the Xdialog? Thanks in advance.
Steve
Not being a big fan of ask variables, I typically just use one screen to get all the parameters I need for a printing from a list of reports/letters. In doing so, different layouts may prompt differently for date variables (e.g. "Date on Letter" vs "Service Start Date"). In the script below you will see that when you change the report selection the date prompts will change in wording as well as availability.
Code:
dim choices as C DIM SHARED View_Print as C DIM SHARED nChoice as N DIM SHARED dFrom as D DIM SHARED dTo as D DIM SHARED dReport as D DIM SHARED dDatePrompt as C DIM shared bFrom as L DIM shared bTo as L DIM shared bReport as L DIM SHARED varC_result as C dim cNum as C choices=<<%ccc% Confirmation of Services Termination of Services Care Plan Transportation Request Blank Transportation Request While I Was Out Request for CCPED 100% Slot %ccc% nChoice = 1 cNum = "1" bFrom = .F. bTo = .F. bReport = .T. cDatePrompt = "Service Start Date:" View_Print = "Print" ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("CCPED Provider Letters/Reports",<<%dlg% {region} {region}Print Option:{endregion}| {region}(View_Print:View); (View_Print:Print);{endregion}; ; {region}Which Report:{endregion}| {region}(nChoice=choices!nChoices_*);{endregion}; ; {region}{text=2,0cNum};{endregion}; {text=20,0cDatePrompt}| [%DATE;P=popup.calendar(dtoc(dReport));I=popup.calendar%.20dReport!dReport_*?bReport]; From Date:| [%DATE;P=popup.calendar(dtoc(dFrom));I=popup.calendar%.20dFrom!dFrom_*?bFrom]; To Date:| [%DATE;P=popup.calendar(dtoc(dTo));I=popup.calendar%.20dTo!dTo_*?bTo]; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% if left(a_dlg_button,6) = "dFrom_" then if a_dlg_button = "dFrom_killfocus" then dFrom = ctod(dtoc(dFrom)) end if a_dlg_button = "" end if if left(a_dlg_button,4) = "dTo_" then if a_dlg_button = "dTo_killfocus" then dTo = ctod(dtoc(dTo)) end if a_dlg_button = "" end if if left(a_dlg_button,8) = "dReport_" then if a_dlg_button = "dReport_killfocus" then dReport = ctod(dtoc(dReport)) end if a_dlg_button = "" end if if left(a_dlg_button,9) = "nChoices_" then bFrom = .F. bTo = .F. bReport = .F. cNum = alltrim(str(nChoice)) if nChoice = 1 .OR. nChoice = 4 bReport = .T. cDatePrompt = "Service Start Date:" else if nChoice = 2 .OR. nChoice = 7 bReport = .T. cDatePrompt = "Letter Date:" else if nChoice = 3 bFrom = .T. bTo = .T. bReport = .T. cDatePrompt = "Client Approval Date:" else if nChoice = 6 bFrom = .T. end if a_dlg_button = "" end if %code%)
When I select a report type by use of a mouse click all works fine. However, when I use the up & down arrows to navigate up and down the list, the choice number (nChoice) is thrown off. Is this a bug of V5? For testing purposes I added the choice number as a character just below the radio buttons. Since this script is not tied to a table or set, it can be run directly with no further downloads.
Does it behave this way for other users? If so, is there a way to disable the up/down keys while in the Xdialog? Thanks in advance.
Steve
Comment