Using IVF 9.1 on XP machine.
GetModuleFileName() below returns the nul terminated str:
gszDirBuffer = 'C:DataIVF ModelProg.exe'
An exception occurs in later code if gszDirBuffer is
terminated with ACHAR(0), as shown below, but NO
exception occurs if terminated with ''C.
iret = GetModuleFileName(NULL, gszDirBuffer, (MAX_PATH+1))
! remove 'prog.exe' from gszDirBuffer
iPos = INDEX(gszDirBuffer, '', BACK = .TRUE.)
! ACHAR(0) here causes exception
gszDirBuffer = gszDirBuffer(1:iPos-1)//ACHAR(0)
! ''C here does not cause exception
gszDirBuffer = gszDirBuffer(1:iPos-1)//''C
If I search for the nul char in both strings above using
iPos = INDEX(gszDirBuffer, ACHAR(0)), iPos is the
same for both lines of code.
This is a Win32 program, and ACHAR(0) terminated str
appears to work as intended. The exception occurs in
code that does not appear related to any calcs that
use the ACHAR(0) terminated str.
What is the difference between "//ACHAR(0)"
and "//''C" (no space between the appostrophes)?
Thanks for any commentsinformation.