Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / New console window

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. New console window
#10962
Posted by: Jeff Glatt 2007-07-11 18:17:42 Last edited by: Jeff Glatt 2007-07-31 06:40:49 (Total edited 9 times)
The newest version of Reginald (and RPC, and REXX GUI) feature a replaced console window.

With the new console, you can create as many console windows as you like.

One of the consoles is the "default console". This is the window that the SAY and PULL instructions operate upon. It is automatically opened whenever you do a SAY or PULL. For example:
SAY "Enter your name:"
PULL NAME
SAY NAME
You can open other consoles yourself by first issuing a LIBRARY statement for rxconsole, and then using the function ConCreate() to create a new console window, ConSay() to output to it, and ConPull() to enter text from it. The first arg to ConCreate() is the quoted name of some variable of your choosing. This is filled in with a handle to the new console window. You then pass this as the first arg to ConSay or ConPull. To close the window, you can call ConDestroy (although all console windows are automatically closed when your script ends).
LIBRARY rxconsole
/* Open a console window and save the handle in "Console1" */
concreate('Console1',,'NODEFAULT', 10 /* X position */, 10 /* Y Position */)
/* Open another window and save the handle in "Console2" */
concreate('Console2',,'NODEFAULT', 50, 50)
/* Output to console 1 */
consay(console1, "This is console 1")
/* Output to console 2 */
consay(console2, "This is console 2")
/* Get a line of input from Console 2 */
line = conpull(console2)
The good news: When you click on the close box for a console window, it simply goes away. You don't get some dialog saying that the program isn't responding and asking to terminate it. If you close a console window that is waiting for a PULL, this raises the SYNTAX condition in your script (which terminates your script if you don't CATCH SYNTAX). When you close the last console window that you've opened, this also raises SYNTAX. (When using consoles in a REXX GUI script, HALT is instead raised, but only if all your other REXX GUI windows are closed too).

More good news: The new console windows play nice with REXX GUI. You can now use them in REXX GUI scripts.

Even better news. You can embed multiple console windows right inside of a REXX GUI window, just like a control. You can change text colors and font too. Here's an example.

NOTE: Click on the "Do PULL" button and type some text to see how to PULL text from the console. To see how the PULL color can be changed, click on the "Change PULL color" button before you press the ENTER key to finish PULL input. (Note: you'll have to click back into the console window to make it active again. Then you can press ENTER).
/*
GUIBEGIN
WINDOW , 81, 238, 400, 200, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , Console example
 PUSH 5, 8, 40, 14, TABSTOP, , SAY1, , Say 1
 PUSH 51, 8, 40, 14, TABSTOP, , SAY2, , Say 2
 PUSH 99, 8, 40, 14, TABSTOP, , CLEAR, , Clear
 GROUP 145, 1, 250, 25, , , , , Background color
 RADIO 150, 11, 39, 10, AUTO|GROUP, , BackColor, , Black
 RADIO 195, 11, 39, 10, AUTO, , , , White
 RADIO 240, 11, 50, 10, AUTO, , , , Light gray
 RADIO 296, 11, 49, 10, AUTO, , , , Dark gray
 RADIO 351, 11, 39, 10, AUTO, , , , Gray
 PUSH 5, 29, 71, 14, TABSTOP, , TextColor, , Change text color
 PUSH 89, 29, 78, 14, TABSTOP, , PullColor, , Change PULL color
 PUSH 175, 29, 40, 14, TABSTOP, , Pull, , Do PULL
 PUSH 301, 29, 43, 14, TABSTOP, , ChangeFont, , Pick font
 PUSH 348, 29, 46, 14, TABSTOP, , SetFont, , Set Courier
 PUSH 224, 29, 68, 14, TABSTOP, , Pull1, , PULL 1 character
DEND
GUIEND
*/

LIBRARY rexxgui, rxconsole
guierr = "SYNTAX"
guiheading = 1

/* Set a few defaults */
backcolor = 1
textcolor = 1
pullcolor = 1

guicreatewindow('NORMAL')
again:
DO FOREVER
 guigetmsg()
 CATCH SYNTAX
   CONDITION()
   SIGNAL again
 CATCH HALT
 FINALLY
   guidestroywindow()
END
RETURN

/* Called when the window and its controls are created, but
 * before it is displayed
 */
wm_initdialog:
  /* Get the size of the window */
  guigetctlplacement(guiwindow, , , "width", "height")

  /* We want to place our console under the buttons. So
  * we need to find where the top of the "lowest" button
  * appears* in the window (ie, its Y position), and its height.
  * We add these two together and subtract from the
  * main window height. Now we know how much height
  * we have free for the console to occupy
  */
 guigetctlplacement('TextColor', "SayX", "SayY", "SayWidth", "SayHeight")
 sayy = sayy + sayheight
 height = height - sayy

  /* Create a console window embedded into our main window.
   * We pass our GuiWindow handle as the second arg to
   * ConCreate(). We also specify the CHILD option. By
   * not specifying the "NODEFAULT" option, text is output
   * to this window with a ConSay command... from
   * anywhere. Text is gotten from this window with a
   * ConPull command... anywhere.
   * NOTE: We don't pass a handle variable name because we
   * don't need it. We can call the other Con functions, omitting
   * the first arg, and it will operate upon the default console.
   */
  concreate(, guiwindow, "CHILD", , sayy, width, height)

  RETURN ""

/* Called when the SAY 1 button clicked */
wm_click_say1:
  /* Output to the console window */
  consay(, "Button 1 was clicked")
  RETURN

/* Called when the SAY 1 button clicked */
wm_click_say2:
  /* Output to the console window */
  consay(, "Button 2 was clicked")
  RETURN

/* Called when the Clear button clicked */
wm_click_clear:
  conclear()
  RETURN

/* Called when the Text Color button clicked. This
 * changes the color of text we print via ConSay
 * or SAY.
 */
wm_click_textcolor:
  /* We just increment the TextColor count. When
   * its 1, we set it to mostly Red. When its 2, we set
   * it to Green. When its 3, we set it to Blue.
   * When its 4, we roll back to 1. Ie, We cycle through
   * 3 different colors. Of course, you can select among
   * millions of colors if you want. 
   */
  textcolor = textcolor + 1
  IF textcolor > 3 THEN textcolor = 1
  SELECT textcolor
    WHEN 1 THEN DO
      red = 180 /* Range for each color value is 0 to 255 */
      green = 40
      blue = 40
    END
    WHEN 2 THEN DO
      red = 40
      green = 180
      blue = 40
    END
    OTHERWISE DO
      red = 40
      green = 40
      blue = 180
    END
  END
  consetcolor(, , red, green, blue)
  RETURN

/* Called when the PULL Color button clicked */
wm_click_pullcolor:
  /* Set the color of text entered via ConPull. We
  * do the same thing as per the Text color. But
  * the PULL color can be different.
  */
  pullcolor = pullcolor + 1
  IF pullcolor > 3 THEN pullcolor = 1
  SELECT pullcolor
    WHEN 1 THEN DO
       red = 180 /* Range for each color value is 0 to 255 */
       green = 40
       blue = 40
    END
    WHEN 2 THEN DO
      red = 40
      green = 180
      blue = 40
    END
    OTHERWISE DO
      red = 40
      green = 40
      blue = 180
    END
  END
  consetcolor(, "PULL", red, green, blue)
  RETURN

/* Called when one of the Background radio buttons clicked.
 * We have a choice of 5 colors for the background.
 */
wm_click_backcolor:
  guigetctlvalue('BackColor')
  SELECT backcolor
     WHEN 1 THEN str = "BLACK"
     WHEN 2 THEN str = "WHITE"
     WHEN 3 THEN str = "LIGHTGRAY"
     WHEN 4 THEN str = "DARKGRAY"
     OTHERWISE str = "GRAY"
  END
  consetcolor(, "BACK", str)
  RETURN

/* Called when the Do PULL button clicked */
wm_click_pull:
  /* Prompt the user to enter text, then get that
   * text. ConPull doesn't return until he enters
   * the text.
   */
  consay(, "Enter some text, then press ENTER")
  text = conpull()

  /* Echo what he typed.
   * Note: If the user closes the window, or aborts
   * while ConPull is entering text, then HALT will
   * be raised. So, we'll never get here.
   */
  consay(, text)
  RETURN

/* Called when the Do PULL 1 character button clicked */
wm_click_pull1:
  /* Exactly the same as with "Do PULL", but we pass
   * a second arg which is how many characters we want
   * the text limited to. Here, that is 1. The allowable
   * range is 1 to 255.
   */
  consay(, "Press a key")
  text = conpull(, 1)

  /* We could echo it with one ConSay call as so...
   * ConSay(, "You pressed the" text "key.")
   * But by passing a third arg of "NOBREAK" to
   * ConSay, you can suppress the line feed. So
   * here is how we can spread the printing across
   * 3 calls to ConSay, but keep it all on 1 line.
   */
  consay(, "You pressed the ", "NOBREAK")
  consay(, text, "NOBREAK")
  consay(, " key")
  RETURN

/* Called when the Pick Font button clicked */
wm_click_changefont:
  /* Preset the font dialog to pick and set the font */
  consetfont(, "")
  RETURN

/* Called when the Set Courier button clicked */
wm_click_setfont:
  /* We specifically set the font to "Courier New", height
   * of 16, and a style of BOLD. Other styles we can add are
   * ITALIC and UNDERLINE, each separated by a | character,
   * for example "ITALIC|UNDERLINE"
   */
  consetfont(, "Courier New", 16, "BOLD")
  RETURN
About ConSay... if you want to suppress the line feed, you can pass a third arg of "NOBREAK". For example:
consay(, "My name is ", "NOBREAK")
consay(, "Jeff ", "NOBREAK")
consay(, "Glatt")
displays "My name is Jeff Glatt" on one line, and then ends the line.
Message2.
#11021
Posted by: PeterJ 2007-07-13 01:05:37 Last edited by: Jeff Glatt 2007-07-12 21:51:19 (Total edited 4 times)
I tried to attach 2 console windows into your example, by adding:
width = width/2
concreate('X1', guiwindow, "CHILD", , sayy, width, height)  
concreate('x2', guiwindow, "CHILD", , sayx+width, sayy, width, height)
But I get the error message:
concreate reports "default console already open"
Is something wrong with my definitions, or is REXX GUI not supposed to have more than one console window?
Message3.
#11026
Posted by: Jeff Glatt 2007-07-13 05:46:13 Last edited by: Jeff Glatt 2007-07-31 06:42:22 (Total edited 3 times)
Yes, you made a mistake. In my example, I do create a default console (which can be printed to either by a SAY statement or a ConSay call, and can be PULL'ed from by either a PULL statement or a ConPull call).

But you can't create more than one of those. For all your other console windows, when you create them, you need to specify the "NODEFAULT" option to ConCreate. So your second call to ConCreate should be:
concreate('x2', guiwindow, "CHILD | NODEFAULT", sayx+width, sayy, width, height)
In fact, you can also specify "NODEFAULT" for the first console window too. What this means is that, if your script ever does a SAY or PULL instruction, then a third (default) console window will automatically pop open for that SAY/PULL. (In my example, SAY/PULL would instead go to that one console window).
Message4.
#11053
Posted by: PeterJ 2007-07-13 14:06:06 Last edited by: PeterJ 2007-07-26 04:43:00 (Total edited 2 times)
... used Jeff's sample to add 4 concurrent consoles ;-)

Peter
 

/*
GUIBEGIN


WINDOW , 81, 237, 400, 200, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , Console example
    FONT 8, 400, MS Shell Dlg
    PUSH 5, 8, 40, 14, TABSTOP, , SAY1, , Say 1
    PUSH 51, 8, 40, 14, TABSTOP, , SAY2, , Say 2
    PUSH 99, 8, 40, 14, TABSTOP, , CLEAR, , Clear
    GROUP 145, 1, 250, 25, , , , , Background color
    RADIO 150, 11, 39, 10, AUTO|GROUP, , BackColor, , Black
    RADIO 195, 11, 39, 10, AUTO, , , , White
    RADIO 240, 11, 50, 10, AUTO, , , , Light gray
    RADIO 296, 11, 49, 10, AUTO, , , , Dark gray
    RADIO 351, 11, 39, 10, AUTO, , , , Gray
    PUSH 5, 29, 71, 14, TABSTOP, , TextColor, , Change text color
    PUSH 89, 29, 78, 14, TABSTOP, , PullColor, , Change PULL color
    PUSH 175, 29, 40, 14, TABSTOP, , Pull, , Do PULL
    PUSH 222, 29, 43, 14, TABSTOP, , ChangeFont, , Pick font
    PUSH 269, 29, 104, 14, TABSTOP, , SetFont, , Set Courier
DEND
GUIEND
*/
vacation='08/08/07'
LIBRARY rexxgui, rxconsole
guierr = "SYNTAX"
guiheading = 1

/* Set a few defaults */
backcolor = 1
textcolor = 1
pullcolor = 1

guicreatewindow('NORMAL')
again:
DO FOREVER
 SAY guigetmsg()
 CATCH SYNTAX
   CONDITION()
   SIGNAL again
 CATCH HALT
 FINALLY
   guidestroywindow()
END
RETURN

/* Called when the window and its controls are created, but
 * before it is displayed
 */
wm_initdialog:
  /* Get the size of the window */
  guigetctlplacement(guiwindow, , , "width", "height")

  /* We want to place our console under the buttons. So
  * we need to find where the top of the "lowest" button
  * appears* in the window (ie, its Y position), and its height.
  * We add these two together and subtract from the
  * main window height. Now we know how much height
  * we have free for the console to occupy
  */
 guigetctlplacement('TextColor', "SayX", "SayY", "SayWidth", "SayHeight")
 sayy = sayy + sayheight
 height = height - sayy

  /* Create a console window embedded into our main window.
   * We pass our GuiWindow handle as the second arg to
   * ConCreate(). We also specify the CHILD option. By
   * not specifying the "NODEFAULT" option, text is output
   * to this window with a ConSay command... from
   * anywhere. Text is gotten from this window with a
   * ConPull command... anywhere.
   * NOTE: We don't pass a handle variable name because we
   * don't need it. We can call the other Con functions, omitting
   * the first arg, and it will operate upon the default console.
   */
  sayy=sayy+5
  sayx=sayx
  width=(width)%2-10  
  height=(height-20)%2 
  concreate('X1', guiwindow, "CHILD | NODEFAULT", sayx,sayy, width, height)  
  concreate('x2', guiwindow, "CHILD | NODEFAULT", sayx+width+7, sayy, width, height)
  concreate('X3', guiwindow, "CHILD | NODEFAULT", sayx,sayy+height+9, width, height)  
  concreate('x4', guiwindow, "CHILD | NODEFAULT", sayx+width+7, sayy+height+9, width, height)
  counter=0
  consay(x1,'Waiting for end of working day')
  consay(x2,'Waiting for the weekend')
  consay(x3,'Waiting for vacation')
  consay(x4,'Waiting for Santa Claus')

ERROR = guiaddctl("TIMER 700")
RETURN ""

/* Called when the SAY 1 button clicked */
wm_click_say1:
  /* Output to the console window */
  consay(x1, "Button 1 was clicked")
  RETURN

/* Called when the SAY 1 button clicked */
wm_click_say2:
  /* Output to the console window */
  consay(x2, "Button 2 was clicked")
  RETURN

/* Called when the Clear button clicked */
wm_click_clear:
  conclear(x1)
  conclear(x2)
  conclear(x3)
  conclear(x4)
  RETURN

/* Called when the Text Color button clicked. This
 * changes the color of text we print via ConSay
 * or SAY.
 */
wm_click_textcolor:
  /* We just increment the TextColor count. When
   * its 1, we set it to mostly Red. When its 2, we set
   * it to Green. When its 3, we set it to Blue.
   * When its 4, we roll back to 1. Ie, We cycle through
   * 3 different colors. Of course, you can select among
   * millions of colors if you want. 
   */
  textcolor = textcolor + 1
  IF textcolor > 3 THEN textcolor = 1
  SELECT textcolor
    WHEN 1 THEN DO
      red = 180 /* Range for each color value is 0 to 255 */
      green = 40
      blue = 40
    END
    WHEN 2 THEN DO
      red = 40
      green = 180
      blue = 40
    END
    OTHERWISE DO
      red = 40
      green = 40
      blue = 180
    END
  END
  consetcolor(x1, , red, green, blue)
  consetcolor(x2, , red, green, blue)
  consetcolor(x3, , red, green, blue)
  consetcolor(x4, , red, green, blue)

  RETURN

/* Called when the PULL Color button clicked */
wm_click_pullcolor:
  /* Set the color of text entered via ConPull. We
  * do the same thing as per the Text color. But
  * the PULL color can be different.
  */
  pullcolor = pullcolor + 1
  IF pullcolor > 3 THEN pullcolor = 1
  SELECT pullcolor
    WHEN 1 THEN DO
       red = 180 /* Range for each color value is 0 to 255 */
       green = 40
       blue = 40
    END
    WHEN 2 THEN DO
      red = 40
      green = 180
      blue = 40
    END
    OTHERWISE DO
      red = 40
      green = 40
      blue = 180
    END
  END
  consetcolor(x1, "PULL", red, green, blue)
  consetcolor(x2, "PULL", red, green, blue)
  consetcolor(x3, "PULL", red, green, blue)
  consetcolor(x4, "PULL", red, green, blue)

  RETURN

/* Called when one of the Background radio buttons clicked.
 * We have a choice of 5 colors for the background.
 */
wm_click_backcolor:
  guigetctlvalue('BackColor')
  SELECT backcolor
     WHEN 1 THEN str = "BLACK"
     WHEN 2 THEN str = "WHITE"
     WHEN 3 THEN str = "LIGHTGRAY"
     WHEN 4 THEN str = "DARKGRAY"
     OTHERWISE str = "GRAY"
  END
  consetcolor(x1, "BACK", str)
  consetcolor(x2, "BACK", str)
  consetcolor(x3, "BACK", str)
  consetcolor(x4, "BACK", str)

  RETURN

/* Called when the Do PULL button clicked */
wm_click_pull:
  /* Prompt the user to enter text, then get that
   * text. ConPull doesn't return until he enters
   * the text.
   */
  ERROR = guiremovectl()
  consay(x1, "Enter some text, then press ENTER")
  text = conpull(x1)

  /* Echo what he typed.
   * Note: If the user closes the window, or aborts
   * while ConPull is entering text, then HALT will
   * be raised. So, we'll never get here.
   */
  consay(x1, text)
  ERROR = guiaddctl("TIMER 2500")
  RETURN

/* Called when the Pick Font button clicked */
wm_click_changefont:
  /* Preset the font dialog to pick and set the font */
  consetfont(x1, "")
  consetfont(x2, "")
  consetfont(x3, "")
  consetfont(x4, "")
 
  RETURN

/* Called when the Set Courier button clicked */
wm_click_setfont:
  /* We specifically set the font to "Courier New", height
   * of 16, and a style of BOLD. Other styles we can add are
   * ITALIC and UNDERLINE, each separated by a | character,
   * for example "ITALIC|UNDERLINE"
   */
  consetfont(x1, "Courier New", 16, "BOLD")
  consetfont(x2, "Courier New", 16, "BOLD")
  consetfont(x3, "Courier New", 16, "BOLD")
  consetfont(x4, "Courier New", 16, "BOLD")

  RETURN


wm_timer:
inst=counter//4
SELECT inst
 WHEN 0 THEN consay(x1,time2go('18:00') 'hours') 
 WHEN 1 THEN consay(x2,days2go(nextwday('SATURDAY'),,'FULL'))
 WHEN 2 THEN consay(x3,days2go(vacation,,'FULL'))
 WHEN 3 THEN consay(x4,days2go('24/12/07',,'FULL')) 
END
counter=counter+1
/* Don't let Rexx Gui process this event. */
    RETURN ""

nextwday:procedure
/* -----------------------------------------------------------------
 * Next Weekday 
 *    NextWday('weekday',date-european-format) 
 * e.g. say NextWday('THURSDAY',date('E')) 
 * -----------------------------------------------------------------
 */
PARSE ARG wd,idate
wd=TRANSLATE(wd)
IF idate='' THEN idate=DATE('E')
PARSE VALUE idate WITH  dd '/' mm '/' yy
yy=RIGHT(yy,2,0)
mm=RIGHT(mm,2,0)
dd=RIGHT(dd,2,0)
idate=dd||'/'||mm||'/'||yy
idate=DATE('B',idate,'E')
DO bdate=idate TO idate+7
   wdate=TRANSLATE(DATE('W',bdate,'B')) 
   IF wdate=wd THEN LEAVE
END
IF wdate \= wd THEN RETURN '??'
RETURN DATE('E',bdate,'B')


days2go:procedure
/* --------------------------------------------------------
 days2Go('14/07/07','24/12/07') 
 return: nn   days until todate 
 days2Go('14/07/07','24/12/07','FULL') 
 return: nn days hh:mm:ss hours  is returned
 * --------------------------------------------------------
 */
PARSE ARG todate,cdate,mode
IF mode='' THEN mode='DAYS'
/* else mode='FULL' */
ndate2=DATE('B',todate,'E')
IF cdate='' THEN ndate=DATE('B')
   ELSE ndate=DATE('B',cdate,'E')
days=ndate2-ndate
IF mode='DAYS' THEN RETURN days
days=days-1
ctime=time2go()
RETURN days||' days '||ctime||' hours'  

time2go: PROCEDURE
PARSE ARG totime,fromtime
IF totime='' THEN totime='24:00:00'
ELSE totime=totime||':00:00'  /* just in case time is not complete */
PARSE VALUE totime WITH  hh ':' mm ':' ss ':' remainder
tt=hh*3600+mm*60+ss
IF fromtime='' THEN fromtime=TIME('N')
   ELSE fromtime=fromtime||':00:00' 
PARSE VALUE fromtime WITH  hh ':' mm ':' ss ':' remainder
ft=hh*3600+mm*60+ss
tt=tt-ft
hh=RIGHT(tt%3600,2,0)
tt=tt-hh*3600
mm=RIGHT(tt%60,2,0)
tt=RIGHT(tt-mm*60,2,0)
RETURN hh||':'||mm||':'||tt 
Message5. Console and guigetctlplacement
#11294
Posted by: Michael S 2007-07-29 22:06:38 Last edited by: Jeff Glatt 2007-07-31 06:43:56 (Total edited 1 time)
Can I use a console handle with REXX GUI's GuiGetCtlPlacement to resize and reposition the window?
Message6. Is this a permanent restriction for consoles .....
#11296
Posted by: Michael S 2007-07-29 22:30:36 Last edited by: Michael S 2007-07-29 22:32:58 (Total edited 1 time)
If you try and do a consay of 50 bytes, and the 10th one is hex 00, then bytes 11 onwards are never shown
Message7.
#11298
Posted by: Jeff Glatt 2007-07-29 22:49:08 Last edited by: Jeff Glatt 2007-07-29 22:51:58 (Total edited 1 time)
Right. Console windows do not display non-printable characters, and 00 has a special "end of line" meaning to many Windows text functions.

Moral of the story: Don't bother trying to display non-printable output to a console window. That output is meaningless. Reformat it as some sort of text output.
Message8.
#11304
Posted by: mestrini 2007-07-30 00:12:44 Last edited by: Jeff Glatt 2007-07-30 05:30:15 (Total edited 2 times)
Yep. That happened a lot to me while i handle a lot with binary files. Even ENTRY control treated as an output (text) window behaves the same.
Message9.
#11321
Posted by: Jeff Glatt 2007-07-30 17:20:50
Try the latest Reginald, and this:
/*
GUIBEGIN
WINDOW , 0, 0, 400, 200, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , My Window
    FONT 8, 400, MS Shell Dlg
    PUSH 260, 20, 97, 14, TABSTOP, , console_button, , Enlarge console
DEND
GUIEND
*/

LIBRARY rexxgui, rxconsole
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
concreate('console', guiwindow, "CHILD | NODEFAULT", 20, 80, 350, 100)  
again:
DO FOREVER
   guigetmsg()
   CATCH SYNTAX
      CONDITION()
      SIGNAL again
   CATCH HALT
   FINALLY
      guidestroywindow()
END
RETURN

wm_click_console_button:
  guisetctlplacement(coninfo(console, 'HANDLE'), 20, 80, 450, 200)
  RETURN
Message10.
#11488
Posted by: DougA 2007-08-15 05:07:58 Last edited by: Jeff Glatt 2007-09-08 15:00:13 (Total edited 3 times)
The console window doesn't display lines as they are SAY'ed to it, but instead waits until my main script returns to its message loop. Why?
Doug
Message11.
#11491
Posted by: Jeff Glatt 2007-08-15 07:05:01
When using REXX GUI, then the window isn't updated until you do a PULL, or a call to GuiGetMsg(). That should happen fairly quickly.
Message12.
#11501
Posted by: DougA 2007-08-15 20:47:23 Last edited by: Jeff Glatt 2007-09-08 15:02:12 (Total edited 2 times)
I have a program that reads a large file, this takes awhile, so I display a "start" message on console.  I want this to show up right away. Then, I have a search process that likewise takes a noticable time (20 sec or so). Again, i post a start, as well as some tracks, debug info, etc on the console so i can follow the action.  But nothing is displayed until the process finishes.
Doug
Message13.
#11506
Posted by: Jeff Glatt 2007-08-16 01:23:53 Last edited by: Jeff Glatt 2007-08-16 01:25:44 (Total edited 1 time)
You get the listbox, or console window, to update with a call:
guigetmsg("CLEAR")
But in this case, at the start of your operation, you should disable your window containing the console, and other open GUI windows, so that some event handler isn't called during this. Then re-enable things after you're done with your operation.

Ideally, when a multi-threaded version of Reginald is done, you'll do these lengthy operations from a secondary thread, and this call won't be needed. (But the disable/enable stuff will be).
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥410.00 ·
 
 
¥288.00 ·
 
 
¥918.00 ·
 
 
¥288.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0