RE: How to format display ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



additem space(25-len(part_nbr) & part_nbr) & space(31-len(description) _
&formatdatetime(date, vbGeneralDate)

This will do it. Notice space(31 for description. It is 1 longer than the
field length, so will always show a space. Also, quit using +, it is a math
sign. Proper coding for string concatenation is &. I know + works, but it
is a holdover from Basic version B.C.

"Mac" wrote:

>
> Part_number Char 25
> Description Char 30
> Date Date 8
>
> output = additem part_nbr+' '+description+date
>
> All the part numbers or descriptions do not have the same lengths so when I
> print it, mess up my listbox's display.
>
> How can I print or fix the length of part number, description etc so it
> prints the same number of characters?
>
> Thx
>
>
>
>
.



Relevant Pages

  • Re: New guy needs help
    ... Your right I did not have the right Char. ... I did fix the problem thanks to all for ... Your original error was here: ... 30 characters, the statement says less than 30 characters - which is it? ...
    (comp.lang.javascript)
  • Re: heeeeeeeeeeeeeeeellllllllllllllppppppppppppppppppppp
    ... Why is using char* a bad thing and why using sprintf a bad thing to, ... can be up to MAX_PATH characters). ... LPSTR lpMsgBuf; ... MessageBox(NULL, lpMsgBuf, "GetLastError() for ...
    (microsoft.public.vc.mfc)
  • Re: heeeeeeeeeeeeeeeellllllllllllllppppppppppppppppppppp
    ... This means that if you develop the bad habit of using char * (left over ... It usually takes me five minutes to create a Unicode version of any of my apps, ... BOOL and bool are different data types. ... can be up to MAX_PATH characters). ...
    (microsoft.public.vc.mfc)
  • Re: Char and Varchar
    ... If the maximum length is short (<= 10 characters), ... maximum length, I also use CHAR. ... I use VARCHAR if long and short ...
    (microsoft.public.sqlserver.server)
  • Re: Char and Varchar
    ... If the maximum length is short (<= 10 characters), ... maximum length, I also use CHAR. ... I use VARCHAR if long and short ...
    (microsoft.public.sqlserver.programming)