Silverfrost Forums

Welcome to our forums

Funny...

30 Apr 2008 6:14 #3093

Sometime it’s funny …

Newer versions of FTN95 are not always compatible to older ones. For instance, “clear_screen@” once was a subroutine, then a function, then again a subroutine. Due to this, I worked very long with an older version and didn’t upgrade.

Few days ago I changed from 2.5 to 4.0 for testing. Again I found a funny difference: Up to now I used “%^`4rd” in a graphics window to set the zoom factor only by %dd%il. Now I see that this is no longer possible – I had to change to %^4rd, the “read-only” option didn’t work any more in this case. More precise: The callback function associated with the command didn't work anymore if the read-only accent is used.

Never touch a running system…

Regards, Wilfried

30 Apr 2008 6:55 #3094

The things that you describe are located in salflibc.dll and so are dependent on its version number. This may sound pedantic but it avoids confusion.

clear_screen@ is a subroutine and it is very unlikely that it was ever a function (in the DLL). The documentation has occasionally been incorrect and likewise the interface that appears in the standard header files.

It is possible to use a DLL function as though it were a subroutine (the return result is simply thrown away) but it seems unlikely that you could use a DLL subroutine as though it were a function (though I have never tried to do this).

We aim to avoid breaking existing ClearWin+ code. If you are aware of any regressions of this kind then we will endeavour to fix them. However, you will need to update to the version of salflibc.dll that comes with version 5.20 of FTN95 or (better still) version 5.21 that is about to be released.

30 Apr 2008 7:21 #3095

Thanks and OK.

Please forget clear_screen@, that was about 8 or 10 years ago. But can you please check the %^`4rd case? If I change the value with the spin wheel and then go to the graphics area with the mouse cursor, the value is reset to the initial value.

Regards, Wilfried

30 Apr 2008 9:05 #3096

Wilfried

I would be willing to check the behaviour that you mention but it will be necessary for you to supply a small program (illustrating the behaviour) and you would first need test your code using the latest version of salflibc.dll otherwise we could be observing a different behaviour.

30 Apr 2008 10:26 #3097

Thank you, Paul.

I will order the latest version and test my code. Here a small example:

  WINAPP 5000000,1000000
  OPTIONS(INTL)

  PROGRAM TEST

  IMPLICIT NONE
  INCLUDE <WINDOWS.INS>

  external     line,finish
  integer*4    j,ii

  common  /intern/  ii

  ii = 100

  j = winio@('%ca[Line]%sc%cc%`gr[rgb_colours]%ff%dd%il%^`4rd',
 *    line,'EXIT',200,200,1L,10,10,200,ii,line)
  end

c

  INTEGER FUNCTION LINE()

  IMPLICIT NONE
  INCLUDE <WINDOWS.INS>

  integer*4    ii

  common  /intern/  ii

  call clear_screen@()
  call draw_line@(1,1,ii,ii,1)

  line = 1
  end

Regards, Wilfried

30 Apr 2008 11:35 #3098

It looks like your code works OK with the current salflibc.dll but you do not get a border around the edit box (not even with %co[data_border]).

WINAPP 
PROGRAM test 
IMPLICIT NONE 
EXTERNAL line 
INTEGER j,ii,winio@ 
COMMON /intern/ ii 
ii = 100 
j = winio@('%ca[Line]%sc%`gr[]%ff%dd%il%^`4rd',line,200,200,1,10,10,200,ii,line) 
END 

INTEGER FUNCTION LINE() 
IMPLICIT NONE 
INTEGER ii 
COMMON /intern/ ii 
CALL clear_screen@() 
CALL draw_line@(1,1,ii,ii,0) 
line = 1 
END 
30 Apr 2008 12:32 #3099

OK, but that can be done with the following modification in the main programme:

  j = winio@('%ca[Line]%sy[3d_thin]%sc%cc%`gr[rgb_colours]'
 *    //'%fn[MS SANS SERIF]%ts%ff%dd%il%^`4rd',
 *    line,'EXIT',200,200,1,.9D0,10,10,200,ii,line)
1 May 2008 3:13 #3100

Wilfred,

While not addressing your problem, I have a different programming style for %winio. By breaking up the tasks and using /debug, I find is easier to find errors in the call arguments. I ran your program on Ver 5.20 and had no problems with ii not being updated.

IMPLICIT NONE 
INCLUDE <WINDOWS.INS> 

external line,finish 
integer*4 j,ii 

common /intern/ ii 

ii = 100 

! j = winio@('%ca[Line]%sc%cc%`gr[rgb_colours]%ff%dd%il%^`4rd', 
!* line,'EXIT',200,200,1L,10,10,200,ii,line) 
!
j = winio@ ('%ca[Wilfred Line Test]&')        ! Caption for window
j = winio@ ('%sy[3d_thin]&')                  ! select windows 95 style edge
j = winio@ ('%sc&', line)                     ! provide a call-back on startup
j = winio@ ('%cc&', 'EXIT')                   ! provide a call-back when closed  ??
j = winio@ ('%`gr[rgb_colours]&', 200,200,1)  ! create a graphics window and provide handle 
j = winio@ ('%fn[MS SANS SERIF]&')            ! select a font for text
j = winio@ ('%ts&',.9D0)                      ! scale font to 90% normal size 
j = winio@ ('%ff&')                           ! form feed
j = winio@ ('%dd&', 10)                       ! insert a spin wheel
j = winio@ ('%il&', 10,200)                   ! select integer limit from 10 to 200
j = winio@ ('%^`4rd', ii, line)               ! read only control 

end 

INTEGER FUNCTION LINE() 

IMPLICIT NONE 
INCLUDE <WINDOWS.INS> 

integer*4 ii 

common /intern/ ii 

call clear_screen@() 
call draw_line@ (1,1,ii,ii,1) 

line = 1 
end 
1 May 2008 12:11 #3106

Thanks, Paul and John.

I'm a bit confused because the little test programme runs perfectly. So I first will find out what exactly is going wrong with my software when upgrading from version 2.5 to 4.0 (or higher). May be I'll find also the solution. In any case I will inform you.

1 May 2008 1:56 #3107

Wilfried (and others),

I'm using 4.9 as my University baulks at upgrading software on a reasonable cycle. I find it worth periodically downloading the Personal Edition, and running things with that, because the PE is the latest version (usually) - just to see if things still work - or work better! So far, I haven't found anything broken, and I then go off to puzzle what I have done to break things.

However, when installing PE, do it on a spare PC, as otherwise the installation of the paid-for version gets wiped!

As far as errors in the documentation are concerned, I operated for a long time not understanding that .true. and .false. were 1 and 0 if one interpreted a LOGICAL as an INTEGER, so that, for example,

    CALL USE_RGB_COLOURS@ (0,1)
    CALL USE_RGB_COLOURS@ (0,.true.)

were completely identical!

John's mode of programming does, in my experience. allow you to more easily find errors.

Regards

Eddie

1 May 2008 5:36 #3111

Quoted from LitusSaxonicum However, when installing PE, do it on a spare PC, as otherwise the installation of the paid-for version gets wiped!

Thanks for this warning, Eddie! It was just my idea to test with the free PE and I already downloaded it...

Regards Wilfried

2 May 2008 6:05 #3116

Wilfred,

A potential source of a problem similar to what you discussed may be that you have not turned OFF %il. %il applies to all following '%rd''s and not just the next one.

Depending on what your bigger program does, and to be safe, after the %rd you could insert the line:-

j = winio@ ('%`il&') ! turns off integer limits from effecting future %rd

This caused me a lot of grief about a year ago !!

I had the code:- kk = 4 j = winio@ ('%rd&', kk) and kk was not being displayed as 4 !

John C.

2 May 2008 9:00 #3122

OK, John, that's a good advise, thanks.

In my case it doesn't help... If I make the %rd read-only like described above there is simply NO call to the callback function (??). So I will go on searching what's the reason.

Up to now I tried your advice (%`il), I tried common block and module for the assossiated value, and some other things - with no result. It is not *really *a problem because I must not use read-only in the particular part of my software. It's just funny...

Have a nice day 😉 Wilfried

2 May 2008 1:39 #3134

Sorry, but the next funny thing occured:

I have a simple ASCII (text) file with names. For instance, in the first line there is my name: Wilfried Linder (with one blank between first and second name).

Now I make a standard read:

open(10,file=...,err=...,...) read(10,'(A)',err=...)name ... close(10)

Only the first part of the name (Wilfried / until the first blank) is read! Up to, the complete line was readed.

More than confused, Wilfried

I think I will go back to the old version (2.50) of FTN95 / slaflibc.dll

2 May 2008 2:32 #3136

Sorry again... the problem just described is solved. After adding one comment line, compiling and linking the programme, then removing that line, compiling and linking again, everything is OK.

I don't understand it, but I think me and my computer need some holidays...

Best regards and a nice weekend, Wilfried

Please login to reply.