 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Mon Aug 18, 2008 9:34 pm Post subject: How to automatically scroll to the end of string in %eb? |
|
|
I'm using an edit box to display status of a running program. The box displays a string composed of sentences followed by CR/LFs, and usually has many such sentences.
Every now and then the program updates status, by appending a sentence (followed by CR/LF) to the string displayed in the box, and doing a window update. Works fine, but when the string gets long enough to scroll off the bottom of the box, a vertical scrollbar appears on the right (as it should), and stays at the top of its range. And the last line(s) of status, which are the most recent, can't be seen unless you reach over and move the slider to the bottom. And then the next time it updates, the scrollbar moves to the top again and you still can't see the latest status.
Anybody know how to tell the box to always display the END of the string, rather than the beginning? With the scrollbar automatically set to the bottom instead of the top, after every update? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Aug 19, 2008 7:52 am Post subject: |
|
|
The help file describes an EDIT_INFO block that can be used with the subroutine EDIT_MOVE_BOF@(E) to move the cursor to bottom of file. |
|
Back to top |
|
 |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Sun Nov 02, 2008 11:28 pm Post subject: |
|
|
Well, I finally got a chance to try this, and of course ran into a problem (story of my life).
The string I'm displaying is called statbuf, and is type CHARACTER*32000. I tried to make the edit box show the end of that string by giving the command CALL EDIT_MOV_BOF@(statbuf), and the compiler complained I was calling a nonexistent function. I then put in a declaration EXTERNAL EDIT_MOV_BOF@ and got chewed out again, now it says that EDIT_MOV_BOF@ has already been declared with the EXTERNAL attribute.
I appear to be doing something wrong. Do I need to INCLUDE something I'm missing? I have INCLUDE <windows.ins> at the top of the program already. Do I need to include anything else? And/or do I need to include something in the actual function where I'm calling EDIT_MOV_BOF@ ?
ON EDIT:
Well, I removed the EXTERNAL declaration, and put INCLUDE <windows.ins> at the top of the actual function where EDIT_MOV_BOF@ is called (now that INCLUDE statement appears twice, once at the top of the main program, and once at the top of the function that actually uuses that EDIT_MOV_BOF@ command). Now it compiles, but I get a doozy of a runtime error: Access Violation The instruction at address 1003f5ec attempted to read from location 0000011e followed by a bunch of traceback info in Swahili.
I'd like to think this is progress, but.........
ON FURTHER EDIT:
Finally read up and found what EDIT_INFO was. Modified the Edit Box, it's now a %`eb with ain integer IEDITB(24) that I pass back and forth in a COMMON block. Now EDIT_MOV_BOF@ sort of works, but now the program just sort of hangs and spins its wheels endlessly. I finally click on the little X in the upper right corner of the main program box to close it down, it stares sullenly at me, then the system announces that the program is not responding.
More to come... |
|
Back to top |
|
 |
Wilfried Linder
Joined: 14 Nov 2007 Posts: 314 Location: D�sseldorf, Germany
|
Posted: Mon Nov 03, 2008 7:52 am Post subject: |
|
|
Hi Little-Acorn,
for status messages I use the following construction:
Code: | integer*4 win
win = create_window@('Info',100,100,700,500)
call open_to_window@(6,win)
write(6,'(A)')string_with_information
call destroy_window@(win) |
This works very fine - may be it is an alternative to your approach. All output is done with a standard Fortran write where unit=6 means text output to screen.
Regards,
Wilfried |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|