{{tag>category:"OpenInsight 64-bit" author:"Greg Helland" author:"Carl Pates"}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== YAGG RTI_SEND_INFO_PROGRESS (recreated) (OpenInsight 64-bit) ==== === At 09 JUL 2019 01:51:00PM Greg Helland wrote: === I like how the rebuild index function in OI-10 shows a number of processes that need to be done and then shows the user where they are in the process. Is this a documented function/subroutine? How do I call this progress entity? What are the parameters? Thanks, Greg Helland President & CEO [url=https://bleupelikan.com/]BleuPelikan, Inc.[/url] ---- === At 10 JUL 2019 11:56AM Carl Pates wrote: === Hi Greg, The routine/dialog in question is called rti_Send_Info_Progress() because it basically emulates some of the old send_info progress behavior from the previous versions of OI (They were called from "outside" OI by the RunOICommandPanel DLL function). Internally we call this the 'Yagg' (Yet another gas gauge :-) 1) To start off the process you make a %INIT% call passing it the phases that you want to report on - you can also pass a parent window for the dialog e.g:[pre] // <1> "%INIT%" // <2> "Database/Repository Synchronization" // <3> "Analyzing" | "Removing" | "Adding" // <4> parentID progressString = PROGRESS_INIT_TOKEN$ progressString = ResToString( REPRES_DBREPSYNCH$, REPRES_SYSTEM$ ); progressString = PROG_ANALYZE$ : @svm : PROG_REMOVE$ : @svm : PROG_ADD$ progressString = parentID progressID = rti_Send_Info_Progress( progressString )[/pre] Note that it returns the ID of the dialog it created - you can use this ID in subsequent update calls if you wish - the dialog is multi-instance so it can be used recursively if you pass this ID so you update the correct one. 2) To update the progress specify the phase you want to update and how far along you are, e.g. [pre] // <1> "Analyzing" // <2> "Getting Database Table List" // <3> pctDone // <4> progressID progressString = PROG_ANALYZE$ progressString = ResToString( REPRES_GETTINGDBLIST$, REPRES_SYSTEM$ ) progressString = pctDone progressString = progressID bVal = rti_Send_Info_Progress( progressString ) ; // Returns TRUE$ if the dialog is still up[/pre] (When you change the phase the previous phase is marked as "complete".) 3) A final step is to close the dialog when you're done. [pre] // <1> %QUIT% // <2> n/a // <3> n/a // <4> progressID progressString = PROGRESS_QUIT_TOKEN$ progressString = "" progressString = "" progressString = progressID call rti_Send_Info_Progress( progressString )[/pre] Equates for this are in RTI_SEND_INFO_PROGRESS_EQUATES. Let me know if you don't have them (they are marked as publishable so they should have made the build). Regards, [url=mailto:cpates@revsoft.co.uk]Carl Pates[/url] PS - if you use this and you're not in event context it behaves just as the normal send_info call - it won't break anything. PPS - the "off-center" image bug you see in your example has been fixed for 10.0.7 ---- === At 10 JUL 2019 11:59AM Greg Helland wrote: === Thanks Carl, I will give it a go. YAGG, like that. FYI, RTI_SEND_INFO_PROGRESS_EQUATES is available. Greg Helland President & CEO [url=https://bleupelikan.com/]BleuPelikan, Inc.[/url] ---- === At 10 JUL 2019 01:18PM Greg Helland wrote: === Carl, A few questions about constants and variables. 1. What should PROG_ANALYZE$, PROG_REMOVE$, and PROG_ADD$ be set to? My assumption is "Analysis", "Remove" and "Adding". If I set these values before the line "progressString = PROGRESS_INIT_TOKEN$" then the return values is not set to %INIT% but set to PROG_ANALYZE$ (Analysis). Should I set those right after that call? 2. The call to "progressString = ResToString( REPRES_DBREPSYNCH$, REPRES_SYSTEM$ )" returns a value of "Failure to read resource record!". I do not know what to set REPRES_DBREPSYNCH$ and REPRES_SYSTEM$ to and there is no online help for this function. 3. The call to "progressString = ResToString( REPRES_GETTINGDBLIST$, REPRES_SYSTEM$ )" does not get set properly. What should REPRES_GETTINGDBLIST$ and REPRES_SYSTEM$ be set to? That is all I have at this point. Thanks for your help. Greg Helland President & CEO [url=https://bleupelikan.com/]BleuPelikan, Inc.[/url] ---- === At 10 JUL 2019 02:21PM Carl Pates wrote: === Hi Greg, [i]"What should PROG_ANALYZE$, PROG_REMOVE$, and PROG_ADD$ be set to? My assumption is "Analysis", "Remove" and "Adding". If I set these values before the line "progressString = PROGRESS_INIT_TOKEN$" then the return values is not set to %INIT% but set to PROG_ANALYZE$ (Analysis). Should I set those right after that call?"[/i] They are just the the strings that identify your phases - they appear as text in a list next to the icons. In the %INIT% call you are just setting them up. The "PROG_" equates in the example I gave you are just strings from the program I pulled the code from. You use your own - they depend on what your process is doing. So you make an %INIT% call first:[pre]// Initialize: // // <1> "%INIT%" (PROGRESS_INIT_TOKEN$) // <2> Title // <3> @svm'd list of phase strings to display // <4> Dialog parent // // The ID of the created dialog is returned and should be passed in // subsequent show progress calls[/pre] Then you call again when you want to update the dialog. You have to tell it which phase you want to update (i.e. one of the phase strings you passed in the %INIT% call), and the text to display with the update[pre]// Show Progress // // <1> Phase string // <2> Phase Info text // <3> Progress Percent // <4> ID of the progress dialog // // Returns TRUE$ if the dialog is still up, or FALSE$ if it isn't.[/pre] The first time you call a phase the icon gets set to the arrow for "processing"; when you change the phase the previous one gets set to the green tick for completed etc... And when you're done:[pre]// Quit // // <1> "%QUIT%" (PROGRESS_QUIT_TOKEN$) // <2> n/a // <3> n/a // <4> ID of the progress dialog[/pre] [i]"2. The call to "progressString = ResToString( REPRES_DBREPSYNCH$, REPRES_SYSTEM$ )" returns a value of "Failure to read resource record!". I do not know what to set REPRES_DBREPSYNCH$ and REPRES_SYSTEM$ to and there is no online help for this function."[/i] You can ignore these equates - it's just an example from system code that uses strings stored in records rather than hardcoding them in source code. Just use whatever string you want for your title. [i]"3. The call to "progressString = ResToString( REPRES_GETTINGDBLIST$, REPRES_SYSTEM$ )" does not get set properly. What should REPRES_GETTINGDBLIST$ and REPRES_SYSTEM$ be set to?"[/i] Ditto. You can ignore them. Regards [url=mailto:cpates@revsoft.co.uk]Carl Pates[/url] ---- === At 10 JUL 2019 02:39PM Greg Helland wrote: === Thanks Carl. This works perfectly. Appreciate your patience.... Greg Helland President & CEO [url=https://bleupelikan.com/]BleuPelikan, Inc.[/url] [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=7D8E2652164362626235590D4|View this thread on the Works forum...]]