Fixed OLE strings
A Fixed OLE String is simply a vector of two-byte integers declared by the user. We call them fixed because the number of characters that can be stored in the string is determined at compile time, and cannot change during execution. A typical Fixed OLE String declaration looks like this:
integer(OLECHAR_KIND),dimension(12)::MyFxOLEString
OLECHAR_KIND is a constant defined in f90VB (for inquiring minds, the constant has the value 2). The maximum number of characters that can be stored in MyFxOLEString is eleven. Although the vector is declared with twelve entries, the last character of a Fixed OLE String must be a null-terminator. f90VB contains the necessary functions and subroutines to transfer the content of standard Fortran strings into Fixed OLE Strings. For example, to copy the literal 'My string' into MyFxOLEString, your Fortran program can use:
Call StrCopy('My string', MyFxOLEString)
Figure 1.5 illustrates the content of vector MyFxOLEString. Note that each entry in MyFxOLEString contains the ASCII code of the respective character in 'My string' literal, and that the string is null-terminated.
As long as you make sure strings stored in a Fixed OLE string are null terminated, you are not forced to call f90VB functions and subroutines to handle them. For example, the following section of code could also be used to initialize MyFxOLEString:
TempFStr='My string'
do i=1,len_trim(TempFStr)
MyFxOLEString(i)=ichar(TempFStr(i:i))
enddo
In this manual, we usually use FOLEStr or FxOLEStr to identify f90VB Fixed OLE Strings.