Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7593771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:15:10+00:00 2026-05-30T21:15:10+00:00

I’m using PowerBuilder and have a problem with the if condition. I want to

  • 0

I’m using PowerBuilder and have a problem with the if condition. I want to check if a variable is not null or it is not empty.

So first I have following if condition to test if the variable is null or not:

IF IsNull(ls_name) THEN
    messagebox("ls_name", "is null")  //true
else
    messagebox("ls_name", "is not null")
end if

From the above condition, I know that ls_name is null. Now I test if its empty or not:

if ls_name = "" then
    messagebox ("ls_name", "is empty")
else
    messagebox("ls_name", "is not empty") //true
end if

And i get that ls_name is not empty.

Now when I use an if condition to check if ls_name is NOT Null or it is NOT empty, I put the following if condition:

IF not IsNull(ls_name) or ls_name <> "" THEN
    messagebox("test", "condition true")
else
    messagebox("test", "condition false")  //this becomes true.
end if

It goes to the else part of the condition. Shouldn’t the if part become true? Am I writing the if condition wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:15:11+00:00Added an answer on May 30, 2026 at 9:15 pm

    Thinking of “null” as “unknown” has always gotten me by in understanding how expressions evaluated.

    So, when ls_name is null,

    not IsNull(ls_name) or ls_name <> ""
    

    evaluates to

    NOT TRUE OR UNKNOWN
    

    or

    FALSE OR UNKNOWN
    

    Well, for an OR to evaluate to TRUE, at least one condition must be TRUE. That doesn’t apply in this case.

    The way I usually test for this is:

    IF NOT (IsNull (ls_name) OR ls_name = "") THEN
    

    which, when ls_name is null, resolves to

    NOT (TRUE OR UNKNOWN)
    

    then

    NOT (TRUE)
    

    and

    FALSE
    

    In other words, the variable is “empty”.

    Good luck,

    Terry

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.