Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Calling "setlocale()" from GAWK (Was: Re: awk challenge)
In article <419c872c@news.012.net.il>,
Aharon Robbins <arnold@skeeve.com> wrote:
>In article <ykPmd.6493$3U4.143215@news02.tsnz.net>,
>Don Stokes <don@daedalus.co.not-this-bit.nz> wrote: 
>
>I still think it's best done with a shell wrapper. You're the only
>one to request it so far, in the almost 4 years since 3.1.0 and
>the i18n features were released.

I have developed an extension (shared lib) to GAWK called "call_any", that
allows you to call "any" (for some definition of any) C library function
from AWK.  So, call_any is more useful than a dedicated way to call
setlocale().

Here is an example, that speaks to this thread topic:

% gawk 'BEGIN {extension(ENVIRON["HOME"]"/lib/call_any.so","dlload")
print "Locale is now:",call_any("sis","setlocale",6,"pt_BR")
s="                     "
print call_any("isisd","strfmon",s,10,"%n",45.156);print s}'
Locale is now: pt_BR
3
£ 45
%

For fun, you can try this with other locales - en_US, en_GB, etc.


Report this thread to moderator Post Follow-up to this message
Old Post
Kenny McCormack
11-23-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

AWK archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:22 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.