Ok I search around but didnt find anything that would help me.
What I have is this.
In our program we have a grouping tool that allows you to select any of the individual fields and display them on the screen.
What I am doing is creating the print button that creates the group in printed format.
The problem comes up when someone selects one of the Memo Fields. The Memo Field converts to a Text field and in place of line breaks there appears a box.
So i was trying to modify the below code. it works the way it is, but i would have to put every single character in.
Does anyone know a way to say don't allow the line return or new line characters? (I think they are #13 and #10)...
Thanks in advance.
What I have is this.
In our program we have a grouping tool that allows you to select any of the individual fields and display them on the screen.
What I am doing is creating the print button that creates the group in printed format.
The problem comes up when someone selects one of the Memo Fields. The Memo Field converts to a Text field and in place of line breaks there appears a box.
So i was trying to modify the below code. it works the way it is, but i would have to put every single character in.
Does anyone know a way to say don't allow the line return or new line characters? (I think they are #13 and #10)...
Thanks in advance.
Code:
[b]function[/b] StripUnwantedChar(Text: string):string;
[b]var[/b]
Allowed: [b]Set[/b] [b]of[/b] Char;
i, LeftOvers: Integer;
[b]begin[/b]
Allowed := [[teal]' '[/teal], [teal]'0'[/teal]..[teal]'9'[/teal], [teal]'a'[/teal]..[teal]'z'[/teal], [teal]'A'[/teal]..[teal]'Z'[/teal], [teal]'~'[/teal]..[teal]')'[/teal], [teal]'-'[/teal], [teal]'.'[/teal], [teal]'\'[/teal], [teal]':'[/teal], [teal]'`'[/teal], [teal]'/'[/teal], [teal]'<'[/teal], [teal]','[/teal], [teal]'>'[/teal], [teal]';'[/teal], [teal]'{'[/teal], [teal]'}'[/teal]];
SetLength(Result, Length(Text));
LeftOvers := [purple]1[/purple];
[b]for[/b] i := [purple]1[/purple] [b]to[/b] Length(Text) [b]do[/b] [b]begin[/b]
[b]if[/b] Text[i] [b]in[/b] Allowed [b]then[/b] [b]begin[/b]
Result[LeftOvers]:= Text[i];
Inc(LeftOvers);
[b]end[/b]
[b]end[/b];
SetLength(Result, LeftOvers-[purple]1[/purple]);
[b]end[/b];