I've been experimenting with a spin control in xDialog.
Our workers keep case notes in a memo field. each entry is date-stamped with the worker code of who created that entry.
Currently, I give them the option to print the notes, but they can sometimes reach 10-20 pages if the case has a lot of information.
I'm trying to give them the option to print only as many pages as they want by parsing through the memo field and building a text variable that gets printed.
This all works, but now I'm trying to "pretty" it up by only letting the spin control have a maximum equal to the "maximum" number of pages in the "full" print.
What I'm trying to do is to have the maximum value in the spin control be a variable.
Any ideas would be greatly appreciated.
Tom
Our workers keep case notes in a memo field. each entry is date-stamped with the worker code of who created that entry.
Currently, I give them the option to print the notes, but they can sometimes reach 10-20 pages if the case has a lot of information.
I'm trying to give them the option to print only as many pages as they want by parsing through the memo field and building a text variable that gets printed.
This all works, but now I'm trying to "pretty" it up by only letting the spin control have a maximum equal to the "maximum" number of pages in the "full" print.
What I'm trying to do is to have the maximum value in the spin control be a variable.
Code:
DIM cb as P cb = table.get("cb_header") DIM parameter1 as C parameter1 = cb.caseno DIM All_Notes as C = "" All_Notes = alltrim(cb.notes) DIM GLOBAL vNotes as C = "" DIM nPg_Count as N = 0 nPg_Count = ceiling(line_count(All_Notes)/48) [COLOR=#FF0000] <--------------------------#lines per page[/COLOR] 'Create an XDialog dialog box to prompt for parameters. DIM SHARED pages as N = 1 DIM SHARED varC_result as C heading_string = "Case Notes Print" DIM Shared Heading2 as C = "There are approximately "+alltrim(str(nPg_Count))+" pages to be printed" [COLOR=#FF0000]<--------------------------------# pages[/COLOR] ok_button_label = "&OK" cancel_button_label = "&Cancel" Delete XdialogStyle dim XDialogStyle as p XDialogStyle.AccentColor = "White" XDialogStyle.Color = "#153+204+255" varC_result = ui_dlg_box("agency",<<%dlg% {Windowstyle=Gradient Horizontal Top} {region} {text=30,1:heading_string}; {lf}; {text=50,1:Heading2}; {endregion}; {region} Please select the number of Pages to Print:| [%z;s1,[COLOR=#FF0000]20[/COLOR]%.8pages]; [COLOR=#FF0000]<------------------------- currently maxed at 20, but here is where I need the variable[/COLOR] {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%) for j = 1 to pages*48 'here is where we build the text variable to print ln = word(all_notes,j,crlf()) vNotes = vNotes+ln+crlf() next j
Tom
Comment