POSIX Awk Coercion

This is a discussion on POSIX Awk Coercion within the awk forums in Programming Languages category; Hi, What does the POSIX Standard for awk say about coercion as described on pages 44-45 of The Awk Programming Language book (1988, Aho, Weinberger, Kernighan)? I.e., "" variable is treated as a string, 0 + variable is treated as a number. Thanks. Bill Seivert...

Go Back   Application Development Forum > Programming Languages > awk

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-06-2008, 03:54 PM
William Seivert
Guest
 
Default POSIX Awk Coercion

Hi,

What does the POSIX Standard for awk say about coercion as described on
pages 44-45 of The Awk Programming Language book (1988, Aho, Weinberger,
Kernighan)?

I.e., "" variable is treated as a string, 0 + variable is treated as a
number.

Thanks.
Bill Seivert
Reply With Quote
  #2  
Old 09-06-2008, 04:08 PM
Kenny McCormack
Guest
 
Default Re: POSIX Awk Coercion

In article <Hfednfs1E7jyQl_VnZ2dnUVZ_qfinZ2d@comcast.com>,
William Seivert <bill80126@comcast.net> wrote:
>Hi,
>
>What does the POSIX Standard for awk say about coercion as described on
>pages 44-45 of The Awk Programming Language book (1988, Aho, Weinberger,
>Kernighan)?
>
>I.e., "" variable is treated as a string, 0 + variable is treated as a
>number.
>
>Thanks.
>Bill Seivert


Have you just answered your own question?

Reply With Quote
  #3  
Old 09-06-2008, 05:04 PM
Jürgen Kahrs
Guest
 
Default Re: POSIX Awk Coercion

William Seivert wrote:

> What does the POSIX Standard for awk say about coercion as described on
> pages 44-45 of The Awk Programming Language book (1988, Aho, Weinberger,
> Kernighan)?


http://www.opengroup.org/onlinepubs/...ities/awk.html

>
> I.e., "" variable is treated as a string, 0 + variable is treated as a
> number.


"An application can force an expression to be treated
as a number by adding zero to it, or can force it to
be treated as a string by concatenating the null string
( "" ) to it.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:37 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.