View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Tue Nov 07, 2023 11:31 am Post subject: LCASE@ and TRIM@ functions |
|
|
I do not find similar functions in gFortran :
call lcase@ (text)
call trim@ (text)
Text is character variable (in my case character*256).
I know there exist simple programs to do the same |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1897
|
Posted: Tue Nov 07, 2023 2:59 pm Post subject: |
|
|
As the FTN95 documentation tells you, you can use the standard intrinsic ADJUSTL instead of TRIM@. For LCASE@, unless you want to convert the entire works of Shakespeare to lower case, the following code should suffice as a replacement.
Code: | program tlcase
implicit none
character*20 :: mstr = 'abcdEFGHijklmN12Qr@#'
call toLower(mstr)
print 10,mstr
10 format(' |',A,'|')
end program
subroutine toLower(str)
implicit none
character(*), intent(in out) :: str
integer*1 itmp(len(str))
integer*1, parameter :: i32 = 32
itmp = transfer(str,itmp)
str = transfer(merge(IOR(itmp,i32), itmp, &
65 <= itmp .AND. itmp <= 90), str)
return
end subroutine |
Last edited by mecej4 on Wed Nov 08, 2023 1:08 am; edited 1 time in total |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Tue Nov 07, 2023 10:37 pm Post subject: |
|
|
Brain crushing solution, thanks mecej4.
Mathematics is foundation of everything |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Wed Feb 07, 2024 6:46 am Post subject: |
|
|
But what also happened with LCASE@ in FTN95 9.0+ ? Was it dropped from the compiler? This makes some older codes broken |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8037 Location: Salford, UK
|
Posted: Wed Feb 07, 2024 7:57 am Post subject: |
|
|
Dan
I don't know of any problems with LCASE@. Can you provide details and sample code? |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Wed Feb 07, 2024 2:28 pm Post subject: |
|
|
Paul,
It behaves a bit unexpectedly, not that it is unsupported in Ver9 but better say kind of lost backward compatibility. If i create an example and compile it with Ver9 all works fine. But if compile with older compilers and run under Ver9 it freezes or crash.
Code: | character*256 text
Text='QWERTY'
print*,trim(text)
call lcase@(text)
print*,trim(text)
end |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8037 Location: Salford, UK
|
Posted: Wed Feb 07, 2024 4:11 pm Post subject: |
|
|
Dan
If you compile using an older FTN95 and run using the latest Silverfrost DLLs then it may well crash. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Wed Feb 07, 2024 11:44 pm Post subject: |
|
|
lcase can crash Clearwin? |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1897
|
Posted: Thu Feb 08, 2024 12:55 am Post subject: |
|
|
Dan, many of the 64-bit RTL routines (such as lcase@, dot_product8@, etc.) are in CLEARWIN64.DLL rather than in SALFLIB64.DLL. Just today I posted a bug report ( http://forums.silverfrost.com/viewtopic.php?p=34982#34982 ) for dot_product8@, and the demonstrator did not use any CLEARWIN features. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Thu Feb 08, 2024 2:21 pm Post subject: |
|
|
Are CLEARWIN64.DLL and SALFLIB64.DLL provided by the different companies? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8037 Location: Salford, UK
|
Posted: Thu Feb 08, 2024 3:24 pm Post subject: |
|
|
CLEARWIN64.DLL and SALFLIBC64.DLL are provided by Silverfrost and are companion DLLs for 64 bit FTN95, SCC and SLINK64.
For 32 bits there is just one DLL which is salflibc.dll but for 64 bits CLEARWIN64.DLL and SALFLIBC64.DLL replace salflibc.dll. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Thu Feb 08, 2024 9:39 pm Post subject: |
|
|
I forgot to put the smile or irony in my last post. I meant what happened with lcase in Ver9 which abruptly started to hiccup after 30 years of previous no problem upgrades ? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8037 Location: Salford, UK
|
Posted: Fri Feb 09, 2024 8:33 am Post subject: |
|
|
Dan
A cure for hicups is to hold your breath for a long time. Long enough to remember to keep compiler and DLL versions in step. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2877 Location: South Pole, Antarctica
|
Posted: Fri Feb 09, 2024 2:43 pm Post subject: |
|
|
Paul,
Looks like the devilry now found your computers too In October in this forum we discussed lcase@ and 3 days later FTN95 Ver.9.0 appeared
I downloaded it in November, installed it on new drives in Linux, in Windows, and when launched my codes they even did not start.
I informed you about two problems with Ver9,0 and got new FTN95. It cured one of them and did not fix lcase@ with you just commented that you can not do anything with it (???). How one can interpret that and how "my breath" and "in step" can fix the issue?
New compiler broke backward compatibility. May be i missed something and you meantime fixed it? No, after that I found new and the only latest DLLs since i reported this bug, i installed them and the problem is still there.
Should i interpret "i can not do anything with it" that now i have to dig into ages and find older compilers' with their Salflibc64 and Clearwin64 to run older codes? 35 years all older codes worked fine with new versions of FTN95.
What, the FTN95 still does not attach needed libraries to EXE? Is this to advertise that FTN95 has one "huge advantage" of having smallest EXE files to fit them into 1.44MB 2.5" floppy drives? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8037 Location: Salford, UK
|
Posted: Fri Feb 09, 2024 5:29 pm Post subject: |
|
|
Dan
I tried to explain that you can't normally use an old version of FTN95 with later (dated) versions of the Silverfrost DLLs.
I will send you the latest FTN95 with compatible DLLs off my machine (probably on Monday). If you use them together then your problems should be solved. |
|
Back to top |
|
|
|