In our work in HotDocs, we often need to bring in defective and malformed data from databases. Often the data source contains an address field or fields. Ideally, it will be formatted with Street, City, State and Zip as separate fields. However, more often, the data is not properly structured for analysis and usage. We may get address line 1 and address line 2 or even address line 3. To put this data into a usable format requires an understanding of text parsing.
With the use of the Custom Functions properties of HotDocs Computations, we have defined a way to parse the Address Line text which is in the [CityName], [StateAbbrev] [ZipCode] format in a line into the 3 separate constituent fields, respectively tmpCity, tmpState, and tmpZip. We pass a parameter, prmCSZ which contains the address string. The output sets the tmp fields which can then be used in a dialog script or other computation to set the actual fields you wish to use.