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

Formatting Names (Whats in a name?)

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

    Formatting Names (Whats in a name?)

    After 2 hrs of reading VERY valuable posts and linking to more than a few that I know I'll be back to, alas I did not see an answer to this ?

    I'll truncate it down to just the ? if I can
    salut is a 5 space char field
    salutcalc is a 6 space char field
    salutcalc field rule calculated : if(isblank("salut"),"",alltrim(salut)+" ")
    now my understanding is that "" puts a null value into a char field

    namecombo is a char field with this calc (truncated): salutcalc+.......

    expected result '( I'll use the tilde to represent the "start" of the namecombo field.

    |Mr. T (with Mr. in the salut field) .or.
    |T (in no salutation is in salut)

    what I get

    |Mr. T (looks like a few extra spaces are included) .or.
    | T (looks like {6?} extra spaces included

    What I am trying to get is if there is a salutation, that salutation followed by a single space then the next field in the equation, and if there is no salutation for the next field in the equation to be at the "start" of namecombo.

    Ok Did I ask this intelligently?

    Jeff


    attaching file if interested

    #2
    Hello Jeffery,

    Well if I understand what you are wanting, how about this:

    Code:
    alltrim(SALUTCALC)+" "+allTRIM(FNAME)+" "+allTRIM(MICALC)+" "+allTRIM(LNAME)+" "+SUFFIX
    Good luck,
    Jim
    Last edited by Jim Chapman; 11-02-2005, 11:38 PM.

    Comment


      #3
      Jeff,

      Looking at your example, you don't need all those calc fields.

      Just put this in namecombo:

      Code:
      IF(SALUT<>"",ALLTRIM(SALUT)+CHR(32),"")+IF(FNAME<>"",ALLTRIM(FNAME)+CHR(32),"")+IF(MI<>"",ALLTRIM(MI)+CHR(32),"")+IF(LNAME<>"",ALLTRIM(LNAME),"")+IF(SUFFIX<>"",CHR(32)+SUFFIX,"")
      Once you do this, make sure you recalculate the calculated fields by right clicking the table, select utilities->Recalc calculated fields(field rules)

      Scott

      Comment


        #4
        deleted when saw the next post
        Last edited by A4BEST; 11-03-2005, 12:38 AM.

        Comment


          #5
          EURIKA! Scott that got it(almost). I thought nested if's might get there but I could not find a notisblank and .not.isblank did not work. Your <>"" is elegant and I will deffinetly be remembering it!!!!!

          The (almost)
          I have probably spent 10 hours on trying to get the L. mask to work and never have been satisfied. I made the mi field 1 char, that forced user to be able to only enter the letter. Micalc takes that letter if its there and adds the period. I plugged micalc into your equation and it works perfectly the way I wanted it to.

          chr(32) is a space I presume and I will be remembering that one also

          Thank YOU so much

          Jeff

          Comment


            #6
            salutcalc is designed to format salut for addition to the char string.
            I'm not sure I'm understanding correctly but I think you are trying to say you want to save the salutation in the field with the extra space on the end. This can't be done. Here's why....

            If a character field in a table is 6 characters long, it is ALWAYS 6 characters long and will be padded on the right with blank spaces if necessary. Therefore, if you try to save "Mr." + " " (4 characters) in a 6 character field, the field will actually store "Mr." plus 3 blank spaces.

            This is why you often need to trim values read from a character field before comparing them or concatenating them. However, when comparing them, sometimes the trimming is necessary and sometimes it's not. If you want to do:
            IF TablePointer.Last_namef = "Smith"
            without trimming the field value, I believe it works just fine. However, the comparison functions at(), atc(), and &, require you to trim the field value first. From the Interactive Editor:
            test = "fred "
            ?at(test,"fred,sam,yuri,jo")
            = 0.000000
            ?at(trim(test),"fred,sam,yuri,jo")
            = 1.000000
            ?test$"fred,sam,yuri,jo"
            = .F.
            ?trim(test)$"fred,sam,yuri,jo"
            = .T.

            FYI: +chr(32) is identical to +" "

            Comment


              #7
              Jeff,

              You still don't need the MICalc, use this:

              Code:
              IF(SALUT<>"",ALLTRIM(SALUT)+CHR(32),"")+IF(FNAME<>"",ALLTRIM(FNAME)+CHR(32),"")+IF(MI<>"",ALLTRIM(MI)+". ","")+IF(LNAME<>"",ALLTRIM(LNAME),"")+IF(SUFFIX<>"",CHR(32)+SUFFIX,"")
              As you can see I just added the period to the calc statement above, and since I did that I removed the chr(32) and just added it to the string. Oh and by the way, the above is not a "nested if", it is just if statements added togeather. A nested if would be a if statement inside a if statement, something like:

              Code:
              If(sky=clouds,IF(clouds>sun,"partly Cloudy","Partly Sunny"),"the Sky is Clear")
              Scott

              Comment


                #8
                Cal, Thank you for the explanation. It deffinetly expanded my understanding of chr fields.

                If I got it right

                A 6 space chr field will be filled/padded to 6 places with spaces to fill field

                IF

                there is ANY data entred in the field.

                Putting "" in a chr field in a formula results in the same way as if you clicked past it during data entry, ie: a "null" value/empty field, ie: field "isblank"

                I am going to play with your tests. A little over my head right now but hey thats how I am going to learn.


                Scott, FANTASTIC!!!

                I was also able to get rid of the alltrim(mi) and just go with mi, since mi is a single chr width field.

                final line:
                IF(SALUT<>"",ALLTRIM(SALUT)+CHR(32),"")+IF(FNAME<>"",ALLTRIM(FNAME)+CHR(32),"")+IF(MI<>"",MI+". ","")+IF(LNAME<>"",ALLTRIM(LNAME),"")+IF(SUFFIX<>"",CHR(32)+SUFFIX,"")

                Added if's, WOW do you have me thinking!!!

                your <>"" (.not.isblank)is much more intuitive to me, being stated after the field to question unlike functions that syntax puts in front of the field

                I don't understand why chr(32) works so much better than " " but hey it does and I'm not going to argue with that!!


                I want to Thank All of you for the help.
                Jeff

                Comment


                  #9
                  Actually, Jeff, I'm pretty sure that putting a "null" into a 6 character field will still leave it with 6 blank spaces - not a null value.

                  Comment


                    #10
                    There is an = operator (equal to) and an == operator (exactly matching). The = operator ignores blanks at the end of a string. The == operator does not ignore them.

                    If salut is blank (or null), sault="" is true.
                    salut=="" is false.

                    Bill.

                    Comment


                      #11
                      == also matches case. The two strings have to be truly identical. It's essentially the equivalent of strcmp() in C.

                      There is also <> and !=. != is 'not exactly equal' vs <> which is a case insensitive, padding insensitive non-equality operator.

                      Originally posted by Bill Parker
                      There is an = operator (equal to) and an == operator (exactly matching). The = operator ignores blanks at the end of a string. The == operator does not ignore them.

                      If salut is blank (or null), sault="" is true.
                      salut=="" is false.

                      Bill.
                      Aaron Brown
                      Alpha Software Development Team

                      Comment

                      Working...
                      X