forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with 'at' character input/output
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Sat May 18, 2013 1:40 pm    Post subject: Reply with quote

Steve,

You have identified the problem of the "lazy" clearwin output window not displaying @, but how about using the active window, say in a %ws or %rs box.
Have you tested these to see what happens ?
I have menu structures which give display windows for updating data. I have not tested them to see if these can accept @, but they may well work differently to the output window, which I use as a background window for debugging information, as a second screen.

Also, a tab character is a special character for input and output which behaves differently, so there are other special characters for data transfer. You try and find how to handle the use of tab in the documentation !!

John

Ps: I just tried changing the names of some items listed in a %ls box and the @ displayed without any problems. The names were read from a text file into a character string, then displayed correctly as listed in the text file.
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Sat May 18, 2013 3:17 pm    Post subject: Reply with quote

Hi John - Good point. I was using the 'lazy' Clearwin window mainly because it's quite a large legacy application and it would be a mammoth task to re-code all the write statements that output to the display. However, I guess I should look again at the feasibility of this. If I can associate a LUN with a %ws window then perhaps it's possible.

Yes, you're right about the tab character, also the LF and CR of course - but these are positioning characters, not display characters. When you press the @ key on the keyboard you expect an @ to be displayed on the screen. The fact remains that without any documentation of the weird behaviour, it has to be considered a bug.
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sun May 19, 2013 7:29 pm    Post subject: Reply with quote

Re:
Quote:
If I can associate a LUN with a %ws window


I don't think you can. But you can embed a programmed clearwin window using %cw ... although don't get excited, it displays the same behaviour as the 'lazy' window.
Code:
      WINAPP
      PROGRAM AT
      INCLUDE <WINDOWS.INS>
      INTEGER, EXTERNAL:: WRITEAT
      IA = WINIO@('%ca[Test for embedded CW window]%2nl%pv'//
     &            '%70.30cw[vscroll,hscroll]&',
     &             99)
      IA=WINIO@('%ww%sc&', WRITEAT)
      IA=WINIO@('%ff%nl%rj%12bt[STOP]'//
     &          '%lw', KONTROL)
      STOP
      END
      INTEGER FUNCTION WRITEAT()
      WRITE(99,*) "@@Blimey!"
      WRITEAT = 1
      RETURN
      END


You would have to use double-@ every time to use this, which is what you would have to do with the lazy window ...

Eddie
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Sun May 19, 2013 8:36 pm    Post subject: Reply with quote

Thanks, Eddie! Good idea, pity it didn't help. Think for now I'll just cut my losses and use ~ instead of @ for the prefix, and hope that no users have any @ characters embedded within their data!

cheers

Steve
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Mon May 20, 2013 4:57 am    Post subject: Reply with quote

Steve,

I have used the menu system to create data entry forms.
With a little bit of effort and a review of the data structures you want for the user interface, they can be very effective.
You need to balance interactive (slow) with file inputs (require skill from the user)
Also need to consider how you get an interupt to review the data that has been entered.
I have used %ls as a selection control, then update the table below for data associated with this %ls selection. (you need a call-back on the %ls selection) %rd and %rf boxes work very well for data, with a few labels. You need to control when you take the updated info and review for errors. ( even an ok button can work.)

Above the %ls I also have some fixed %rd, %rf and %rs fields for key controls of the run. (a %rs field can be updated by the user or program to control the run option label)

If as I find, there are only a few key data structures that require this approach, while lots of other data is in files, then you can get a more effective solution with only a few data interface menu options. It realy is worth experimenting. You'll waste a few nights with the layout !

Eddie has much more experience in this area, so he might have more ideas.

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Mon May 20, 2013 7:10 am    Post subject: Reply with quote

Sorry for the delayed response on this item.
I will try to take a look at it later today.
Back to top
View user's profile Send private message AIM Address
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Mon May 20, 2013 7:50 am    Post subject: Reply with quote

John - Many thanks for the thoughts. If I can identify the key areas where data listing is done, it could well be possible to use the Clearwin+ functionality for users to view the data, though the problem will still be there in the Clearwin transcript window which the user would want to keep as a record of the session. However, another option for that would be to echo everything to a print stream, assuming this wouldn't have the same problem (next thing for me to try out!).

Paul - thanks. That would be very helpful. I'm sure there must be a fairly simple solution to this!

-Steve
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Mon May 20, 2013 9:32 am    Post subject: Reply with quote

Steve,

You wrote : "Clearwin transcript window which the user would want to keep as a record of the session"
I do not know how to save the output window transcript. For me, once it closes it is lost. I write my trascript to another trace file ( that I open on unit 98, which I have used as a log unit for many years in many programs !)

Make sure that this "Output" window is available to you.

You might also be interested in the way I close this window, as it can hang around. Then again we might be discussing different "lazy" windows ?

Code:

      subroutine close_output_window
!
      INCLUDE <windows.ins>
!
      integer*4 hwnd
      logical   L
!
      hwnd = FindWindow("SalfordClass", "Output")
      write (98,*) hwnd,' = FindWindow("SalfordClass", "Output")'
      if (hwnd < 1) return
      L    = DestroyWindow (hwnd)
      write (98,*) L,   ' = DestroyWindow(hwnd)'
!
      end subroutine close_output_window
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Mon May 20, 2013 10:20 am    Post subject: Reply with quote

John,

The embedded %cw window (in an earlier post) - which coincidentally is unit 99 - is straightforward Clearwin, so you can close it with an appropriate setting of the variable KONTROL (provided that is in a MODULE or COMMON). You can also send a message to a particular window to 'go and close itself' using SEND_TEXT_MESSAGE@ and also get a reply. It is also easily scrollable, up to some maximum length.

Once the stuff is sent to a display window, if you want to save it, you have to recapture it. My understanding is that you can cut'n'paste from such a %cw window, although FTN95.CHM is a bit vague on this, mentioning the standard callback COPY but not the others such as SELECT_ALL, and I've never done it. There may well be a lines limit too, although this appears to be user-selectable.

It is much easier to do a dual write: one to a file, and one to a window. The one thing you don't want is a 'PRINT NOW' button, as (of course depending what goes into a log file) they can get very long before you realise it!

Eddie
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Mon May 20, 2013 11:18 am    Post subject: Reply with quote

Good point, John .... in the old coding, there is in fact an 'ECHO' parameter. When set, this echoes everything that is written to the transcript to a "printer" stream (actually to a file, together with the old carriagecontrol feature for page feed etc). I had hoped to avoid needing this by a simple 'select all' copy and paste from the CW window, but have just tried and found you can't do a select/copy operation on it. So I'll just have to make sure the echo functionality is preserved! By the way, I don't use the window close coding that you quoted - just a program 'stop' seems to close the winodw perfectly OK!

-Steve
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Mon May 20, 2013 12:19 pm    Post subject: Reply with quote

1. Sometimes the text window sticks around if the program stops due to an error when you are developing a program. That inhibits a link step, and you need to kill off the hanging window with the task manager.

2. Having inserted the line:

IA=WINIO@('%ac[F1]&','COPY')

into my demo (previous posting) I discover that selecting the whole of '@Blimey!' by pressing F1 gives nothing to paste, but selecting just 'Blimey!' allows pasting of '@Blimey!', i.e. the '@' seems to come from nowhere. So @ clearly has some major significance! Also, putting an accelerator in with SELECT_ALL as its callback doesn't work.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Mon May 20, 2013 2:03 pm    Post subject: Reply with quote

It turns out that ClearWin windows have an "escape" character and the default "escape" character is '@'.

If you are using %cw then %`cw provides a handle and the function set_win_escape@ can be used to change the default escape character to something else.

Code:
      C_EXTERNAL SET_WIN_ESCAPE@ '__set_win_escape' (VAL,VAL)


Code:

      i=winio@('%30.3`cw[hscroll,vscroll]&',10,cwh1)
      i=winio@('%lw',ctrl)

      call set_max_lines@(cwh1,50)
      call set_win_escape@(cwh1, '\')


If you are just using Fortran PRINT etc in a Windows program then the simplest solution may be for me to provide a routine to enable you to set your own default escape character.
Back to top
View user's profile Send private message AIM Address
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Mon May 20, 2013 2:11 pm    Post subject: Reply with quote

Paul - That's brilliant -- can use what you've posted (and can set up the CW window explicitly), or if you could write a little routine to do it that would be even better! Is this one that should usefully be added to the knowledgebase list?

By the way, you've also just generated a new FTN95 sale. Impressive support response! My old v3.0 licence needed updating.

Interesting -- I had a compiler problem with that C_EXTERNAL statememt so thought I'd look in the CHM file and the printed manual. And what did I find but SET_WIN_ESCAPE is listed as an obsolete Clearwin subroutine - but the printed manual gives instructions on how to call it. Compiled and linked OK, now just about to test ....

-Steve
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Mon May 20, 2013 3:05 pm    Post subject: Reply with quote

Paul,

I knew you had the answer.

Perhaps we all should have consulted "Clearwin+ Fortran Edition" dated June 1995 (page107, or page 103 where ADD_TEXT_DESCRIPTOR is described), where the use of <ESC_CHAR>tn to modify text characteristics is described. For the simple minded like me, the ESC_CHAR is not ESC (CHAR(27))! This looks like it is possible to set fonts, font characteristics (italic, bold etc) and colour on the fly in a Clearwin window...

This also requires ignoring the mention of SET_WIN_ESCAPE@ being obsolete (FTN95.CHM).

Paul, Do you want my copy of this manual? I had to brush cobwebs off it.

Eddie
Back to top
View user's profile Send private message
silicondale



Joined: 15 Mar 2007
Posts: 243
Location: Matlock, Derbyshire, UK

PostPosted: Mon May 20, 2013 3:33 pm    Post subject: Reply with quote

Eddie, your copy of Clearwin+ Fortran Edition is even older than mine. My copy is dated 4th July 1997. However, mine has a note under SET_WIN_ESCAPE that it is a Clearwin 3.1 function that is obsolete in ClearWin+

I wonder how many other obsolete functions could usefully be revived? They could even be spun as "new features" !

- Steve
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
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