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 

Funny...

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



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Wed Apr 30, 2008 7:14 am    Post subject: Funny... Reply with quote

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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 30, 2008 7:55 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Wed Apr 30, 2008 8:21 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 30, 2008 10:05 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Wed Apr 30, 2008 11:26 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 30, 2008 12:35 pm    Post subject: Reply with quote

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]).

Code:
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
Back to top
View user's profile Send private message AIM Address
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Wed Apr 30, 2008 1:32 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu May 01, 2008 4:13 am    Post subject: Reply with quote

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.

Code:

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
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Thu May 01, 2008 1:11 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Thu May 01, 2008 2:56 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Thu May 01, 2008 6:36 pm    Post subject: Re: Reply with quote

LitusSaxonicum wrote:
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
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Fri May 02, 2008 7:05 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Fri May 02, 2008 10:00 am    Post subject: Reply with quote

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 Wink
Wilfried
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Fri May 02, 2008 2:39 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Wilfried Linder



Joined: 14 Nov 2007
Posts: 314
Location: Düsseldorf, Germany

PostPosted: Fri May 02, 2008 3:32 pm    Post subject: Reply with quote

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
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