Remove Leading Space in Time Answers

HotDocs Version:HD6, HD2005, HD2006, HD2007, HD2008, HD2009
Word Processor:Microsoft Word, WordPerfect
Added to Knowledge Base:September 2004

In HotDocs, time values are usually represented with Text variables that use the 99:99 A.M. pattern. Unfortunately, when the answer for a time variable includes a single digit hour, HotDocs includes an extra space before the time when it is merged into a document. You can use the following computation to format the time without the leading space.

This computation looks at the first character in the answer. If it is a space, the computation returns all of the characters in the answer except for the first character. Otherwise, if the first character is not a space, the entire answer is returned. In your template, instead of using the name of the time variable, you would use the name of the computation, as follows:

  The meeting will begin at «Meeting Time Comp» and will last approximately one hour.
Example:
"" 
IF FIRST( Time Var, 1 ) = " " 
  LAST( Time Var, LENGTH( Time Var ) - 1 ) 
ELSE  
  Time Var 
END IF 

 Time Var

Any Text variable that uses the 99:99 A.M. time format.