Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Numeric 0 vs. numeric blank

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Numeric 0 vs. numeric blank

    Have a bit of a conundrum. This application requires a numeric field (due to arithmetic calculations)with a blank(empty)or minus - result under 1 set of circumstances, and a zero (0) result under different circumstances. Therefore I can't use zero suppress on print. No problem getting a zero result, but no luck with blank e.g. val(str(0)), even tried a minus sign - for a blank.
    Any suggestions would be appreciated.

    John Gamble

    #2
    RE: Numeric 0 vs. numeric blank

    John,

    I recently struggled with a similar problem. I was storing servey questionnaire output in logical and numeric fields and the person analyzing the data needed to distinguish between blanks (nuls) and zero values for numerics and nuls and false values for the logicals.

    I solved the problem in a roundabout way with a patch which you wouldn't want to use. However my plans for such cases in the future may be relevant.

    I shall simply use character fields because (I think) only character fields allow for easy manipulation of nul values. If I have to do arithmatic manipulations I will convert as necessary.

    The only alternative I could think of was to have a twin field to each numeric field to hold information about whether the numeric was blank or zero. The twin field could be logical or character.

    I'd be very interested in others' ideas and experiences with this issue.

    Bill
    Bill Hanigsberg

    Comment


      #3
      RE: Numeric 0 vs. numeric blank

      If I understand correctly that you want your database field for your "number" to hold a "blank" in certain cases, I think you will have to use xbasic.

      "fld>.blank_put()
      Syntax:
      "Fld>.blank_put() , or
      "Tbl>. Fieldname.blank_put()
      Description:
      Places a blank value in the specified field. The field can be specified either by a
      field object pointer ("Fld>), or by a table object pointer ("Tbl>) and
      Fieldname. The field type can be character, date, logical, or numeric.
      All fields are blank before data is entered into them.
      Example:
      'This script is attached to a button on a form. It changes the
      'current record so that all of its fields are blank.
      '----------------------------------------------------------------
      tbl = tbl.current()
      tbl.change_begin()
      FOR i = 1 TO tbl.fields_get()
      fld = tbl.field_get(i)
      fld.blank_put()
      NEXT i
      tbl.change_end(.T.)
      parent.resynch()


      I suppose you could change your field to character and have your calculation store "" (empty quotes) or the text equivalent of the number returned.

      Also be aware that a numeric [u]variable[u] cannot be blank.
      There can be only one.

      Comment


        #4
        RE: Numeric 0 vs. numeric blank

        Hi again,

        If I go the character field route I will consider getting away from interpreting empty fields altogether and use a field rule to stuff some character such as a dash ("-") in the field if nothing else has been entered.

        That way "-" unambiguously means no data has been entered; an empty field could be due to anything.

        A long time ago I read an article by C.J. Date on "The Problem of Nuls." Recently I've come to appreciate what all the fuss was about which was not the case when I first read the article. I think it may be time to revisit the library.

        All the best,
        Bill
        Bill Hanigsberg

        Comment


          #5
          RE: Numeric 0 vs. numeric blank

          Stan
          Thanks for the info. I am trying to solve problems without resorting to xbasic if at all possible. I will try the character route suggested by Stan and if unsuccessfull I may have to resort to xbasic
          Thanks John

          Comment


            #6
            RE: Numeric 0 vs. numeric blank

            Bill
            Am trying the character route. Will update later.
            Thanks John

            Comment


              #7
              RE: Numeric 0 vs. numeric blank

              This is the nice thing aboyut A5V4. You can set up nifty applications without much Xbasic code. The Xbasic code can make your application faster. But having the option is the power of ALPHA

              Bob Sullivan

              Comment


                #8
                RE: Numeric 0 vs. numeric blank

                I may be missing the point here, but what if you kept the calculated field the same, but simply displayed the result in a form or report in a separte calculated field ( not saved ) the way you want. Something like:

                if(calc->amt amt,10,2))

                Comment


                  #9
                  RE: Numeric 0 vs. numeric blank

                  John, here's an expression that will separate the blank numeric values from the zero values (field name is AVERAGE):

                  IF(ISBLANK("AVERAGE"),"BLANK",IF(ISNOTBLANK("AVERAGE").AND.AVERAGE=0,"ZERO","NOT BLANK"))

                  I put this in a report as a calc field (you could use it on a form too). You can substitute the words I used (BLANK, etc.) for the conditions you need.

                  Comment


                    #10
                    RE: Numeric 0 vs. numeric blank

                    John
                    The problem is that because I am dealing with a numeric field your sample & mine to, result in a zero not blank. below is the expression I am using,

                    if("SK" $ Hardware->Keying,val(str(Dhi->Bit3)), if(Hardware->Dhi = " ",val(str(0)),
                    case( Gmkbit3-Dhi->Bit3>0,Dhi->Bit3, Gmkbit3-Dhi->Bit3=0,Dhi->Bit3, Gmkbit3-Dhi->Bit3

                    Comment


                      #11
                      RE: Numeric 0 vs. numeric blank

                      Bill
                      Sounds like a great expression for a character input field. However my problem is creating a numeric printed output of "blank". Please have a look at the expression I posted to John Zaleski. I have also tried using character fields and "val" but somewhere in the expression they fail. Am I overlooking the obvious ?.
                      Thanks John

                      Comment


                        #12
                        RE: Numeric 0 vs. numeric blank

                        John,
                        I backed up again to your opening message. The problem is how to display the info when printing?? You have circumstances that you want a blank value, a zero value or a muneric value (I think). What if you left the original calc field as is ( you get a zero value when it should be
                        zero or when it should be blank ). You have another character field "blankval" ("yes or "no") that tests only the conditions that make it blank. On a report when printing, you could use a conditional object. Condition "blankval" = "yes" displays nothing. Condition blankval = "no" displays the calculated numeric field.

                        Comment


                          #13
                          RE: Numeric 0 vs. numeric blank

                          I like it. will try
                          Thanks very much
                          John

                          Comment


                            #14
                            RE: Numeric 0 vs. numeric blank

                            John
                            Not having much luck with conditional object. I'm not sure of the proper construct. I have tried the expession if(c field=" ","-","+") (minus & plus just for test purposes)
                            to test it and it evaluates correctly. When I try to run the report I get an illegal operation and shutdown.Also while I understand your concept, not sure how to implement it. The help system is not much help. The psuedo code is:
                            if numeric field A-B > 0 print field B
                            if numeric field A-B

                            Comment


                              #15
                              RE: Numeric 0 vs. numeric blank

                              John,

                              Drag a conditional object onto your report.
                              In properties, place two conditions
                              1)character field "DHI" = blank label-blank
                              2)character field "DHI" blank label-notblank
                              You are putting conditions here that evaluate to true or false.

                              Right click on object and check blank - nothing here
                              Right click on object and click notblank - numeric calc

                              What you are doing is saying do not print anything if blank, but print numeric calc field if it's not blank.
                              Your numeris calc field evaluated to 0 for the isblank condition, but you are just not showing it if it isblank.

                              If conditional objects are new to you,you will be happy you learned how to use them. Good luck.

                              Comment

                              Working...
                              X