Vb Script To Read Only The First 2 Line Of A Memo Field.
I'm creating a lable that extracts data from the DB in a memo field that has multilpe lines of data.
I just need to read and display the first 2 line from that field.
Thanks.
-
Have you tried using the "Truncation" transform to discard the characters of data that you don't want? Are the "lines of data" marked by a fixed character length, or a carriage return and line feed?
0 -
I have used trancation, and it does not work for all the data.
The data in the memo field may have several lines and I wanted to only pull out the first 2 lines.
They are not of a fixed lenght. They do have carriage return after each line.
0 -
Then use a VB script to find the position in the string of the second carriage return Chr(13) using the InStr() function, and then use the Left() function to set the value of the data source as being only everything to the left of that position value.
InStr FunctionReturns the position of the first occurrence of one string within another.InStr([start, ]string1, string2[, compare])ArgumentsstartOptional. Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. If start contains Null, an error occurs. The start argument is required if compare is specified.string1Required. String expression being searched.string2Required. String expression searched for.compareOptional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values. If omitted, a binary comparison is performed.0
Please sign in to leave a comment.
Comments
3 comments