![]() |
|
||||||||||||||||||||||||
|
|
Simple BStrings manipulation (BStrAllocExamples) This is a simple example illustrating how easily you manipulate BStrings in Fortran using f90VB. In particular you should notice the following points:
And here is the example:
|
||||||||||||||||||||||||
Program BStrAllocExamples
!Demonstrates the use of function BStrAlloc
!Copyright (C) 1999-2000, Canaima Software, Inc.
!All rights reserved
!load f90VB modules
use f90VBDefs
use f90VBBStrings
implicit none
!declare two Bstrings
integer(BSTRHNDL_KIND):: BStrA, BStrB
character(len=25):: FStr
!Allocate and initialize BStrA
BStrA = BStrAlloc('Example string')
!Allocate and initialize BStrB with the first
!seven characters from BStrA
BstrB= BStrAlloc(BstrA,7)
!Copy BStrA into a Fortran string for printing
call StrCopy(BstrA, FStr)
!Print info about BStrA
print *,'BStrA:', FStr
print *,'BString A Length:',StrLenTrim(BStrA)
!Copy BStrB into a Fortran string for printing
call StrCopy(BstrB, FStr)
!Print info about BStrA
call StrCopy(BstrB, FStr)
print *,'BStrB:', FStr
print *,'BString B Length:',StrLenTrim(BStrB)
!Free string memory
call StrFree(BStrA)
call StrFree(BStrB)
stop
end
|
|||||||||||||||||||||||||
|
Copyright
© 1998-2000 Canaima Software
For questions regarding this site, send an e-mail to webmaster@canaimasoft.com |
|||||||||||||||||||||||||