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 

Getting started with ClearWin

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
eric_carwardine



Joined: 13 Jun 2009
Posts: 70
Location: Perth, Western Australia

PostPosted: Mon Apr 05, 2010 12:29 pm    Post subject: Getting started with ClearWin Reply with quote

G'day, folks Smile

It's slowly dawning on me that I should be learning Fortran for Windows, rather than just running (or trying to run) Fortran programs in a DOS window via command.com

How might I get started with ClearWin? What downloads do I need? I already have FTN95 Personal Edition.

Eric, in Perth, Western Australia
Back to top
View user's profile Send private message Send e-mail Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Mon Apr 05, 2010 12:38 pm    Post subject: Reply with quote

Eric,
There should be a few demo files with the distribution and the FTN95.chm also gives examples. But try this:
Code:

      winapp
      program test
      implicit real*8 (a-h,o-z)
      character*24 text_in
      include <windows.ins>
      real_value = 0d0
      int_value   = 0
      i=winio@('%ca[Put up a caption]&')
      i=winio@('%bg[btnface]&')
      i=winio@('Text entry %`bg[white]%rs&',text_in)
      i=winio@(%ff'Real*8 entry %`bg[white]%rf&',real_value)
      i=winio@(%ff'Int*4 entry %`bg[white]%rd&',int_value)
      i=winio@('%ff%tt[End]')
      print *,taxt_in
      print*,real_value,int_value
      end


Just a quick starter - there is so much more
Hope it helps
Ian
Back to top
View user's profile Send private message Send e-mail
eric_carwardine



Joined: 13 Jun 2009
Posts: 70
Location: Perth, Western Australia

PostPosted: Mon Apr 05, 2010 1:22 pm    Post subject: Reply with quote

Thanks, Ian Surprised

The ftn95 compiler 'complained' about a couple of lines -

Code:

i=winio@(%ff'Real*8 entry %`bg[white]%rf&',real_value)
i=winio@(%ff'Int*4 entry %`bg[white]%rd&',int_value)


"Illegal character combination '(' followed by '%' "

Eric
Back to top
View user's profile Send private message Send e-mail Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Mon Apr 05, 2010 5:54 pm    Post subject: Reply with quote

Hi Eric,
Sorry, I was at work, and there was an automatic upgrade to Vista about to happen, I had 8 seconds left to post this and I had not fully checked it. Quotes were in the wrong place - see below.

Code:

      i=winio@('%ffReal*8 entry %`bg[white]%rf&',real_value)
      i=winio@(%ffInt*4 entry %`bg[white]%rd&',int_value)

Regards
Ian
Back to top
View user's profile Send private message Send e-mail
eric_carwardine



Joined: 13 Jun 2009
Posts: 70
Location: Perth, Western Australia

PostPosted: Tue Apr 06, 2010 4:58 am    Post subject: Reply with quote

G'day, Ian Smile

Sounds like one of those thriller movies, where the hero just manages to upload the secret document as the door opens Very Happy

Here's the complete code for your example, in case somebody is following in my footsteps. ClearWin certainly seems the way to go.

Code:

      winapp
      program test
      implicit real*8 (a-h,o-z)
      character*24 text_in
      include <windows.ins>
      text_in=' '
      real_value = 0d0
      int_value   = 0
      i=winio@('%ca[Put up a caption]&')
      i=winio@('%bg[btnface]&')
      i=winio@('Text entry %`bg[white]%rs&',text_in)
      i=winio@('%ffReal*8 entry %`bg[white]%rf&',real_value)
      i=winio@('%ffInt*4 entry %`bg[white]%rd&',int_value)
      i=winio@('%ff%tt[Click to Go!]')
      print *,text_in
      print*,real_value,int_value
      end


Eric
Back to top
View user's profile Send private message Send e-mail Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Tue Apr 06, 2010 7:11 am    Post subject: Reply with quote

Eric,
Of course that was totally simple, you need "callbacks"

Try these modifications:
Code:

      winapp
      program test
      implicit real*8 (a-h,o-z)
      character*24 text_in
      common/text_stuff/text_in
      common/number_stuff/real_value,int_value,itext_length,product
      include <windows.ins>
      external icb1
      text_in=' '
      real_value = 0d0
      int_value   = 0
      i=winio@('%ca[Put up a caption]&')
      i=winio@('%bg[btnface]&')
!circumflex adds callback to control
      i=winio@('Text entry %`bg[white]%^rs&',text_in,icb1)
      i=winio@('%ffReal*8 entry %`bg[white]%^rf&',real_value,icb1)
      i=winio@('%ffInt*4 entry %`bg[white]%^rd&',int_value,icb1)
!use of grave accent makes field write only
      i=winio@('%ff%nlNumber of characters'// %`rd&',itext_length)
      i=winio@('%ffProduct %`rf&',product)
      i=winio@('%ff%tt[Click to Go!]')
      print *,text_in
      print*,real_value,int_value
      end
! callback number 1 - does everything with all fields
! can be split into multiple callbacks specific to each input field
      integer*4 function icb1()
      implicit real*8 (a-h,o-z)
      character*24 text_in
      common/text_stuff/text_in
      common/number_stuff/real_value,int_value,itext_length,product
!  if function result is 1, updated all fields in form
      icb1 = 1
      itext_length = leng(text_in)
      product       = real_value * int_value
      end


This code is totally untested, I'm just eating my breakfast and then off to work to fight with my new Vista downgrade, slower and a whole new set of bugs.
Regards
Ian
Back to top
View user's profile Send private message Send e-mail
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Apr 08, 2010 9:15 am    Post subject: Reply with quote

Ian,

When I first started with Clearwin+, I managed to get some examples of what I wanted to do from Salford, then off I went.
It would be good if the present examples could be better documented, including the types of tasks that are performed. This could be enhanced by users. This is something that Dan has been suggesting recently.

I have one basic clearwin menu program that has a %gr display. I adapt this for all new projects. It covers a good range of functionality and if this functionality was documented with examples of how it is achieved, it would be very useful for others. Some functionality includes:
- background graphics to enable motion displays
- use of porthole windows to blow-up
- use of full mouse input
- even simple menus that can quickly enable interactive program operation,
- and probably many others

We should try to develop a way of enabling this documentation.
Lahey tried it a few years ago but it never went anywhere. With the vast range of things that can be done in Clearwin, this may be more effective.

John
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
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