bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] How to test if a variable is uninitialized or is just a v


From: Aharon Robbins
Subject: Re: [bug-gawk] How to test if a variable is uninitialized or is just a variable that happens to be an empty string?
Date: Wed, 17 Oct 2012 23:12:51 +0200
User-agent: Heirloom mailx 12.5 6/20/10

Greetings. Re this:

> Date: Mon, 8 Oct 2012 20:43:57 -0500
> From: Peng Yu <address@hidden>
> To: address@hidden
> Subject: [bug-gawk] How to test if a variable is uninitialized or is just a
>  variable that happens to be an empty string?
>
> Hi,
>
> I'm not able to find a function to test if a variable is uninitialized
> or is just a variable that happens to be an empty string in the
> manual. Is there such a function in awk? Thanks!

You can use

        if (x == 0 && x == "")

to test if `x' is uninitialized. The condition will be true only if so.

Thanks,

Arnold



reply via email to

[Prev in Thread] Current Thread [Next in Thread]