Silverfrost Forums

Welcome to our forums

Getting started with ClearWin

5 Apr 2010 11:29 #6259

**G'day, folks **:)

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

5 Apr 2010 11:38 #6260

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

      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

5 Apr 2010 12:22 #6262

Thanks, Ian 😮

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

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

[size=18:83b2bf1b86]'Illegal character combination '(' followed by '%' '[/size:83b2bf1b86]

Eric

5 Apr 2010 4:54 #6264

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.

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

Regards Ian

6 Apr 2010 3:58 #6265

**G'day, Ian **:)

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

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

      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

6 Apr 2010 6:11 #6266

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

Try these modifications:

      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

8 Apr 2010 8:15 #6268

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

Please login to reply.