Results 1 to 2 of 2

Thread: trimming blank fields to 0

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    Eastern Kentucky
    Posts
    14
    hello

    i am converting one file to another from an old dos program and the old file has some empty fields that i don't want in the new file. i have been able to convert the file but it brought all the empty fields. i tried these statements with not results Please help

    if trim(Len(Name)) = 0 then skip saving this record
    if Len(trim(Name)) = 0 then skip saving this record

    neither works Please help

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Canada
    Posts
    264
    Well, the second one should have worked, but it might be that there is a hidden character there, so you can't see it, but it still counts in the len ..

    try adding:

    replace (name,vbrclf,"")
    for counter=0 to 32
    replace (name,chr(counter),"")
    next

    if isnull(trim(Name)) then skip saving this record
    if trim(Name) = "" then skip saving this record

    Hope it helped ..






    In the beginning the universe was created. This has made a lot of people very angry and is generally regarded as a bad idea.

    - Douglas Adams
    The Hitchhiker's Guide to the Galaxy

Posting Permissions

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



Click Here to Expand Forum to Full Width