"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.09.0-win64/examples/other-languages/C++/alias.bas" (1 Jan 2022, 415 Bytes) of package /windows/misc/FreeBASIC-1.09.0-win64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' An example showing that FB namespaces can use aliases,
    2 '' in this case it's used as a work-around: the C++ namespace is named "str",
    3 '' but that's an FB keyword, so on the FB side this example uses "str_".
    4 
    5 extern "c++" lib "alias"
    6     namespace str_ alias "str"
    7         declare sub ucaseme( byval inout_str as zstring ptr )
    8     end namespace
    9 end extern
   10 
   11 dim as zstring * 7 s
   12 s = "Hello!"
   13 
   14 print s
   15 str_.ucaseme( s )
   16 print s