Alpha Video Training
Results 1 to 5 of 5

Thread: Blanks

  1. #1
    Member
    Real Name
    Harry
    Join Date
    Feb 2009
    Location
    UK
    Posts
    66

    Default Blanks

    I'm using the following code in a character field. Working nice except some of my records have blank fields.

    Code:
    alltrim(title)+""+alltrim(firstname)+""+alltrim(surname)+crlf()
    +alltrim(address1)+crlf()+alltrim(address2)+crlf()+alltrim(towncity)
    +crlf()+alltrim(county)+crlf()+""+alltrim(hometel)
    What is the best way to get rid of the blanks?

    Thanks

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Blanks

    Try.

    Code:
    if(isnotblank("title"),alltrim(title),"")+" "+if(isnotblank("firstname"),alltrim(firstname),"")+" "+if(isnotblank("surname"),alltrim(surname),"")+crlf()+if(isnotblank("address1"),alltrim(address1),"")+crlf()+if(isnotblank("address2"),alltrim(address2),"")+crlf()+if(isnotblank("towncity"),alltrim(towncity),"")+crlf()+if(isnotblank("county"),alltrim(county),"")+crlf()+""+if(isnotblank("hometel"),alltrim(hometel),"")
    There can be only one.

  3. #3
    Member
    Real Name
    Harry
    Join Date
    Feb 2009
    Location
    UK
    Posts
    66

    Default Re: Blanks

    Thanks for the reply Stan,

    Tried it but it is still the same.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Blanks

    Forgot about the line feeds.

    If there will always be a surname, at least, in the first line - this should do it.

    Code:
    if(isnotblank("title"),alltrim(title),"")+" "+if(isnotblank("firstname"),alltrim(firstname),"")+" "+if(isnotblank("surname"),alltrim(surname)+crlf(),"")+if(isnotblank("address1"),alltrim(address1)+crlf(),"")+if(isnotblank("address2"),alltrim(address2)+crlf(),"")+if(isnotblank("towncity"),alltrim(towncity),"")+crlf()+if(isnotblank("county"),alltrim(county)+crlf(),"")+""+if(isnotblank("hometel"),alltrim(hometel),"")
    Moved the

    +crlf()

    inside the if statements.
    There can be only one.

  5. #5
    Member
    Real Name
    Harry
    Join Date
    Feb 2009
    Location
    UK
    Posts
    66

    Default Re: Blanks

    Works great Stan, :)

    Thankyou very much for your time.

    Harry

Similar Threads

  1. Removing blanks
    By dcorcoran in forum Alpha Five Version 7
    Replies: 5
    Last Post: 05-23-2008, 01:26 PM
  2. stripping blanks and a zero
    By Patrick Browne in forum Alpha Five Version 5
    Replies: 5
    Last Post: 02-03-2004, 12:48 AM
  3. sys_open with blanks in text.
    By CALocklin in forum Alpha Five Version 5
    Replies: 3
    Last Post: 10-24-2002, 08:27 AM
  4. Pop-Up on Mismatch and blanks
    By Rhett Scott in forum Alpha Five Version 4
    Replies: 3
    Last Post: 06-20-2000, 09:18 PM
  5. Remove leading blanks?
    By Jeff Moses in forum Alpha Five Version 4
    Replies: 1
    Last Post: 06-16-2000, 04:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •