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
silicondale



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

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

OK, just done the test. Unintended consequences. While the (obsolete) SET_WIN_ESCAPE clears the @-char problem, I now have a different problem elsewhere. I use the COUA@ subroutine to write out a prompt with suppression of the linefeed that normally follows a WRITE, so that user input goes on the same line. Unfortunately, this prompt now goes into another brand new Clearwin window that seems to be opened specially for it! Oh well, I'm sure I'll find another way around this one. It's all one big learning experience.

... 10 minutes later

Problem solved. Opening the lazy CW window with

iwin = Create_Window@ (....)
i = Set_Default_Window@ (...)
call Open_to_Window@ (lun,iwin)

iwin is the handle of the window created. All that is needed then is to add the obsolete function

call Set_Win_Escape (iwin1,'~')

to change the escape character from @ to ~

Job done.

many thanks, Paul, Eddie, John, and all!




- Steve


Last edited by silicondale on Mon May 20, 2013 4:15 pm; edited 1 time in total
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 4:14 pm    Post subject: Reply with quote

Steve,

WIN_COUA (p96) has parameters of Window_handle, string, No_of_chars

Is this the one?

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 4:21 pm    Post subject: Reply with quote

Eddie -

Not WIN_COUA (p348 in my edition) but COUA@ (in FTN95.CHM) which takes only one argument, the character string to output. Yes, WIN_COUA would have done the job, as the window handle is one of the arguments. But not needed now (see 2 posts up) - just a call to SET_WIN_ESCAPE for the lazy window does the trick.

-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 4:27 pm    Post subject: Reply with quote

The 'problem solved' section didn't say solved COUA@ !!

So I was just guessing.

However it looks to me that by judicious use of the Escape sequence to change font characteristics you could have prompts and answers in different font style &/or colour too ...

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


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

PostPosted: Mon May 20, 2013 4:40 pm    Post subject: Reply with quote

I will add to the code for set_win_escape@ so that, when the first argument is zero, the second argument becomes the default escape character.

If you seriously can use the functionality of the escape character, perhaps someone could write a paragraph for me to put in the help file. If I ever knew what it does, I have forgotten.
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 4:46 pm    Post subject: Reply with quote

Eddie - Now that would be interesting. But as my main priority is just to get the program running properly before doing fancy stuff with the graphics, I think that's an avenue I won't be exploring for a while! Thanks for all your help and encouragement. Things have come a long way since my first Fortran program in 1971 (and my first Algol-60 program in 1967). Though there's actually still some 1972-73 vintage code in the program I'm working on now.

Paul - seems that Eddie might know something of the functionality! As far as I was concerned (the reason for this thread) it was just a nuisance as there seemed no reason for the @ character to behave differently from others! However, I agree, it would be good to document it if there is functionality that nobody is using only because it's supposed to be obsolete.

- 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: Tue May 21, 2013 2:42 pm    Post subject: Reply with quote

Once you know what is possible, it isn't all that difficult. The following was produced with some assistance from that old Clearwin manual.

Code:
      WINAPP
      PROGRAM AT
      COMMON / CLEARWIN_HANDLE/ iCW_Handle
      INCLUDE <WINDOWS.INS>
      INTEGER, EXTERNAL:: WRITEAT
      IA = WINIO@('%ca[Test for embedded CW window]%2nl%pv'//
     &            '%70.30cw[vscroll,hscroll]%lc&',
     &             99, iCW_Handle)
      IA=WINIO@('%ww%sc&', WRITEAT)
      IA=WINIO@('%ac[F1]&','COPY')
      IA=WINIO@('%ff%nl%rj%12bt[STOP]'//
     &          '%lw', KONTROL)
      STOP
      END
      INTEGER FUNCTION WRITEAT()
      COMMON / CLEARWIN_HANDLE/ iCW_Handle
      INCLUDE <WINDOWS.INS>
      CALL GET_SYSTEM_FONT  (LFHEIGHT,  LFWIDTH, LFESCAPEMENT,
     &     LFORIENTATION,    LFWEIGHT,          LFITALIC,
     &     LFUNDERLINE,      LFSTRIKEOUT,       LFCHARSET,
     &     LFOUTPRECISION,   LFCLIPPRECISION,   LFQUALITY,
     &     LFPITCHANDFAMILY, LFFACENAME)
      LFITALIC = 1
      NEWFONT = CreateFont  (LFHEIGHT,  LFWIDTH, LFESCAPEMENT,
     &     LFORIENTATION,    LFWEIGHT,          LFITALIC,
     &     LFUNDERLINE,      LFSTRIKEOUT,       LFCHARSET,
     &     LFOUTPRECISION,   LFCLIPPRECISION,   LFQUALITY,
     &     LFPITCHANDFAMILY, LFFACENAME)
      CALL ADD_TEXT_DESCRIPTOR (iCW_Handle, NEWFONT, RGB@(255,0,0))
      LFITALIC = 0
      LFUNDERLINE = 1
      NEWFONT = CreateFont  (LFHEIGHT,  LFWIDTH, LFESCAPEMENT,
     &     LFORIENTATION,    LFWEIGHT,          LFITALIC,
     &     LFUNDERLINE,      LFSTRIKEOUT,       LFCHARSET,
     &     LFOUTPRECISION,   LFCLIPPRECISION,   LFQUALITY,
     &     LFPITCHANDFAMILY, LFFACENAME)
      CALL ADD_TEXT_DESCRIPTOR (iCW_Handle, NEWFONT, RGB@(0,0,255))
      WRITE(99,*) "@t1This is the default font - maybe for headings"
      WRITE(99,*) "@t2This is the first additional font - red, italic"
      WRITE(99,*) "@t3This is the next additional font - blue, upright"
     &            //", underlined"
      WRITEAT = 1
      RETURN
      END


To Steve, I say that if you have 'conversational' prompted input in a CW window, colour is a terrific way of distinguishing prompt from reply.

To Paul, I say that there really is no substitute for something like the above, so it isn't really obsolete at all. It therefore deserves mention in the CHM file, and possibly in the Knowledgebase. I haven't a clue whether or not it works with TrueType fonts, and indeed, what possible settings there are for the 14 variables.

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



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

PostPosted: Tue May 21, 2013 3:26 pm    Post subject: Reply with quote

Excellent, Eddie. I guess somebody must know how it works. Definitely worth proper documentation!
_________________
(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: Tue May 21, 2013 4:28 pm    Post subject: Reply with quote

Back in 2009 Paul introduced an option to %cw i.e. %cw[local_font] that makes the %cw window use the currently defined font, i.e. uses current %fn and %ts, but this doesn't allow colour and style changes within the text.

E
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Tue May 21, 2013 6:33 pm    Post subject: Reply with quote

Paul,

Here's my suggestion for what to put in FTN95.CHM (as requested):

In the section headed “Clearwin windows”
    Remove ADD_TEXT_DESCRIPTOR@ and SET_WIN_ESCAPE@ from the obsolete list.
    Add a section describing the %cw[local_font] option, i.e. if this option is chosen then the font currently selected using %fn and %ts is used as the default font for the %cw window.
    Add a section about using ADD_TEXT_DESCRIPTOR@ to define multiple fonts for a particular %cw window, and how they are selected with an ESCape sequence, @tn embedded in the output.
    Add a section explaining how to change the ESCape code from @ if that symbol is required in the output.
    Put the subroutine names in the library reference


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


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

PostPosted: Wed May 22, 2013 8:45 am    Post subject: Reply with quote

Many thanks for all your contributions.

Here is an alternative sample based on Eddie's code

Code:
winapp
program at
include <clearwin.ins>
integer ia,kontrol,icw_handle,hfont2,hfont3
ia=winio@('%ww%ca[Test for embedded CW window]&')
ia=winio@('%pv%60.10`cw&', 99, icw_handle)
ia=winio@('%ac[F1]&','COPY')
ia=winio@('%it%gf%`it&', hfont2)
ia=winio@('%ul%gf%`ul&', hfont3)
ia=winio@('%ff%nl%rj%6bt[Stop]%lw', kontrol)
call add_text_descriptor(icw_handle, hfont2, rgb@(255,0,0))
call add_text_descriptor(icw_handle, hfont3, rgb@(0,0,255))
write(99,*) "@t1This is the default font - maybe for headings"
write(99,*) "@t2This is the first additional font - red, italic"
write(99,*) "@t3This is the next additional font - blue, upright"
end
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



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

PostPosted: Wed May 22, 2013 6:46 pm    Post subject: Reply with quote

Oh, that's excellent! Avoids that awful CreateFont stuff.

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



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

PostPosted: Wed May 22, 2013 10:44 pm    Post subject: Reply with quote

Paul -
Many thanks for taking all this seriously and coming up with such an elegant solution! Really appreciated.
- Steve
_________________
(Steve Henley)
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu May 23, 2013 3:58 am    Post subject: Reply with quote

That rainbow of colors makes CWP very nice looking. Is it possible to change the font in Simpleplot %pl control similar way?
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Sep 29, 2016 9:25 pm    Post subject: Reply with quote

I would like to get my hands on a copy of this old manual for these functions specifically. I've tried searching, but, alas, no valid hits.

Is there a way for someone to upload it and post the link here so the rest of us can get a copy?

Assuming it is in PDF or some electronic form!

I have implemented the @t construct to notify my users of important status messages! And learned some valuable information along the way.
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 3 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