StrFortran
f90VB Modules
f90VBDefs, f90VBBStringsCasting
Summary
Function StrFortran is a casting function that can receive a Fixed OLE String, a Fortran OLE String or a BString and returns an equivalent Fortran String. This function is especially useful when you need to pass any of these f90VB types to a Fortran intrinsic function or subroutine that expects a Fortran string. This function is only available to Fortran 95 compilers.
Syntax
| character(len=*) function StrFortran | (StrSrc, CodePage, Flags, DefaultChar) |
| { | |
| integer(OLECHAR_KIND),dimension(:),intent(in):: | StrSrc | |
| type(OLESTRING),intent(in):: | StrSrc | |
| integer(BSTRHNDL_KIND),intent(in):: | StrSrc |
| } | |
| integer(LONG_KIND),intent(in),optional:: | CodePage |
| integer(DWORD_KIND),intent(in),optional:: | Flags |
| character(len=1),intent(in),optional:: | DefaultChar |
Arguments
StrSrc [Input]
String to be cast into a Fortran String. StrSrc can be a Fixed OLE String, a Fortran OLE String or a BString.
CodePage [Input, Optional]
Code page used to perform the conversion from Unicode strings (Fixed OLE Strings, Fortran OLE Strings and BStrings) to ANSI/Multibyte strings (Fortran strings). This argument can be given the value of any code page that is installed or available to the system. If CodePage is not passed, function StrFortran assumes the default value (CP_ACP). See subroutine StrCopy for a description of available code pages.
Flags [Input, Optional]
A set of bit flags that specify the handling of unmapped characters when converting from Unicode strings to ANSI/Multibyte strings. If this argument is not passed, StrFortran will use the default flags (MB_PRECOMPOSED). See subroutine StrCopy for a description of available flags.
DefaultChar [Input, Optional]
Character used if a Unicode character cannot be represented in the specified code page when converting from Unicode strings to ANSI strings. If this argument is not passed to StrFortran, the procedure uses the system default value. See subroutine StrCopy for more information.
Comments
StrFortran is a casting function that returns a Fortran ANSI string that can be used in any context where a Fortran String is expected. The length of the returned string is the same as the length in characters of the string passed as an argument. This function is especially useful to print the content of BStrings, Fortran OLE Strings and Fixed OLE Strings.
Note: This function is included to support future functionality in f90VB and is not available in the current version the library.