For Programmers: Free Programming Magazines  


Home > Archive > Fortran > November 2007 > Problems in using NLSSetLocale function.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problems in using NLSSetLocale function.
Devendra

2007-11-23, 4:27 am

Hi ,

I'm trying to print some french string but it is not displaying it
correctly from fortran subroutine.
Same thing works well with C program. I'm using Intel fortran compiler
9.0 .

---------------------------------------------------------------------------
int main()
{
setlocale(LC_CTYPE, "french-belgian");
printf("\nMise =E0 jour de la masses r=E9partie...\n");
FrenchFromFortran();
}

subroutine FrenchFromFortran
integer(4) status
status =3D NLSSetLocale( 'French' )
write(*,*) 'Mise =E0 jour de la masses r=E9partie...'
end
---------------------------------------------------------------------------
Output=3D=3D>
---------------
Mise =D3 jour de la masses
r=DApartie... ..... FORTRAN output
Mise =E0 jour de la masses
r=E9partie... ..... c program output


--------------
Devendra
Dr Ivan D. Reid

2007-11-23, 4:27 am

On Thu, 22 Nov 2007 21:46:32 -0800 (PST), Devendra <dgatkal@gmail.com>
wrote in <57170993-b18a-4dc5-b423-c71a18554d6e@a39g2000pre.googlegroups.com>:

> I'm trying to print some french string but it is not displaying it
> correctly from fortran subroutine.
> Same thing works well with C program. I'm using Intel fortran compiler
> 9.0 .


> ---------------------------------------------------------------------------
> int main()
> {
> setlocale(LC_CTYPE, "french-belgian");
> printf("\nMise à jour de la masses répartie...\n");
> FrenchFromFortran();
> }


> subroutine FrenchFromFortran
> integer(4) status
> status = NLSSetLocale( 'French' )


There's not much point in asking for the status of an operation
and then ignoring it. You should check for an error return, it might
tell you something.

> write(*,*) 'Mise à jour de la masses répartie...'
> end


--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
Devendra

2007-11-26, 4:25 am

> > status = NLSSetLocale( 'French' )
>
> There's not much point in asking for the status of an operation
> and then ignoring it. You should check for an error return, it might
> tell you something.
>

OK ... It's Returning 0 to me.

Regards,
Devendra
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com