Silverfrost Forums

Welcome to our forums

%rs control is not refreshed with new salflibc.dll

2 Jan 2021 7:31 #26857

The following example works well with salflibc.dll dated 2019-12-29. After installation of FTN95 version 8.70 the new salflibc.dll is dated 2020-11-17. Since then the filename in the %rs control is not refreshed after return from the call back function with return value 1.

Please try the following example with old and new salflibc.dll:

Program Example Implicit None

Character (len=50) :: FileName Common FileName

Integer :: i Integer, External :: iii, xxx

FileName = 'C:\00 Sonstige\03 Thomas\Example.f90' i = WINIO@('%mn[&File]&',iii) i = WINIO@('%mn[&Exit]&',xxx) i = WINIO@('%1nlFileName:%ta&') i = WINIO@('%tc[red]%`50rs%tc&',FileName,-1) i = WINIO@('%1nl') End

Integer Function iii() Implicit None Character (len=50) :: FileName Common FileName FileName = 'X:\123\Test.txt' iii = 1 end

Integer Function xxx() Implicit None xxx = 0 end

2 Jan 2021 9:53 #26858

The documentation says:

If %`rs is specified, then the string presented can only be changed by the program using WINDOW_UPDATE@(value).

Therefore you need to modify your code:

Program Example
Implicit None

Character (len=50) :: FileName
Common FileName

Integer :: i
Integer, External :: iii, xxx

FileName = 'C:\00 Sonstige\03 Thomas\Example.f90'
i = WINIO@('%mn[&File]&',iii)
i = WINIO@('%mn[&Exit]&',xxx)
i = WINIO@('%1nlFileName:%ta&')
i = WINIO@('%tc[red]%`50rs%tc&',FileName,-1)
i = WINIO@('%1nl')
End

Integer Function iii()
Implicit None
Character (len=50) :: FileName
Common FileName
FileName = 'X:\123\Test.txt'
call window_update@(FileName)    !#########
iii = 1
end

Integer Function xxx()
Implicit None
xxx = 0
end
2 Jan 2021 10:10 #26859

Thanks, Kenny. And all the best for the new year!

I was not aware of the documentation regarding %rs. It worked without windows_update@ actually for a very long time. During my today's investigation and tests I became already aware of this subroutine but considered this initially only as a workaround and not as a permanent solution. Now, after your confirmation, I have to change my mind. Unfortunately there is a larger number of programs where I used %rs.

3 Jan 2021 8:26 #26860

Thomas

If the amount of work needed is excessive then please let me know.

I could probably add a mechanism to opt for the old behaviour.

3 Jan 2021 9:40 #26861

A mechanism to re-activate the old behaviour would be great, provided that it will be realised as a permanent solution.

It's not urgent to get it resolved but urgent to know if there will be a solution in the medium term or not. For a short period we can keep the old salflibc.dll.

4 Jan 2021 9:25 #26864

Thomas

I have sent you a personal message with a link to a new set of DLLs.

You will need to add the following line (once) to your code at the start of your main program (say) before the first call of winio@ with %`rs.

call clearwin_option@('rs_read_only')
4 Jan 2021 11:22 #26867

Paul,

This works perfectly for my applications. The number of %`rs references is not too large (56 references in 13 Fortran source files out of a 3901 fortran source files in total), because it is used in a limited number of central subroutines. The number of application specific callback functions, which request the refreshment of the text items, is however significant larger.

I could now reduce the effort by adding the call to clearwin_option@ to a central initialisation function and it works for all applications.

Thank you for quick and efficient support.

20 Apr 2021 11:56 #27582

Paul, Are these dlls available as I'm having trouble updating %`rs fields. Ian

20 Apr 2021 12:59 #27583

Ian

Yes. The latest DLLs can be downloaded via

https://forums.silverfrost.com/Forum/Topic/3780

Please login to reply.