I have a small subroutine transferring text from keyboard entries, etc from lower to uppercase letters. I used this routine for CVF and the version shown below I also apply for IVF Win32 applications. What happens is that the program crashes with the error message:Unhandled exception at 0x7790DF7C (ntdll.dll) in CaFeMS1-IVF.exe: 0xC0000005: Access violation writing location 0x002A0FFC... before the line ILENGTH = len_trim(STRING) - 1 where a breakpoint is set.
The subroutine is linked from a library file.
Can anyone give me a tip?
Program listing follows here:
! IF(I.GT.IEND)GOTO 2000 ! 25/5-2000
! ICOM is character*2
READ(IDEDIT,202)ICOM
CALL TRANS_TO_UPPERCASE(ICOM,2)
SUBROUTINE TRANS_TO_UPPERCASE(STRING,LENGTH)
use IFPORT
INTEGER*4 KAR,ILENGTH,LENGTH
CHARACTER*(LENGTH)STRING
c CHARACTER*(40)STRING
! ILENGTH = LNBLNK(STRING)
ILENGTH = len_trim(STRING) - 1
C....Transfer STRING to uppercase letters....................
DO 1000 I=1,ILENGTH
KAR=0
KAR=ICHAR(STRING(I:I))
IF(KAR.GE.97)STRING(I:I)=CHAR(KAR-32)
1000 CONTINUE
RETURN
END