NER line breaks

nkuebelbeck

nkuebelbeck

VIP Member
I need to be able to create a large string from multiple lines using NER (UBE) that shows up with line breaks when displayed using a multi line form control.

I can't seem to get it to work. what am I missing?
 
How are you trying to handle line breaks in your code?

I don't know how too. This field is normally populated with text from a media object. The text eventually finds it's way to a BI Pub document. I just need to append something to the end (with some line break)
 
I ended up writing a BSFN and using jdeStrncat to append "\n" to a string
 
You could play about with adding the hexadecimal '0D' to the text yourself. There is BSFN B9861B Add a Carrige Return to String that seems to work just fine for me

It's limited to 254 bytes, but I've cloned this in the past and made the field 5000 text, just in case

To prove it works, call it in Object Browser and paste it's output into here. You'll see you cursor magically appear on the next line. Word doesn't like it for some reason
 
Last edited:
That's too funny. I was searching for "carriage" but could only find b4205350. B9861B would have worked. face palm
 
That's too funny. I was searching for "carriage" but could only find b4205350. B9861B would have worked. face palm

LOL .. I did the same search yesterday and gave up on it. Was going to suggest creating a bsfn and you beat me to it.
 
"B9861B Add a Carrige Return to String" is not safe either... it uses strcat without checking the strings length.
 
Be careful with jdeStrncat (strncat). By itself it is NOT "safe" either. Passing length of destination string (or length - 1) does NOT bounds check the destination. To mimic strcat_s which DOES bounds check the destination I use this:

Code:
/***************************************************************************************  
	Macro:	acmeStrcat_s(PJSTR s1, jde_n_char nBufferSize, const JCHAR * s2)

	Notes:	Appends s2 to s1 up to the capacity of s1 (not including the null-term).
				Although this is meant as a replacement for jdeStrncat - due to the fact
				that most existing code as of 1/11/10 was using jdeStrncat incorrectly 
				to avoid buffer overflows - it does NOT have the same behavior as jdeStrncat.  
				jdeStrncat will append n number of chars from s1 to s2 and doesn't have any buffer overrun protection.
				For a true replacement to jdeStrncat that also has buffer overflow protetion
				use acmeStrncat_s.

	params:
		s1					Null-terminated destination string
		s2					Null-terminated source String
		nBufferSize		Size of s1 in number of characters (jde_n_char).  Use DIM(s1) for a JCHAR array.
	
	Returns: 
		PJSTR

		Returns the same pointer that jdeStrncat returns.

	Example:
		acmeStrcat_s(s1, DIM(s1), s2);


	Developer note:
		This is roughly equivelent to wcscat_s or strcat_s except that currently the underlying
		implementation is jdeStrncat to be as compliant as possible with jde coding standards.
 */
#define acmeStrcat_s(s1, nBufferSize, s2) \
	jdeStrncat(s1, s2, nBufferSize - jdeStrlen(s1) - 1)
 
Be careful with jdeStrncat (strncat). By itself it is NOT "safe" either. Passing length of destination string (or length - 1) does NOT bounds check the destination. To mimic strcat_s which DOES bounds check the destination I use this:

Code:
	jdeStrncat(s1, s2, nBufferSize - jdeStrlen(s1) - 1)

this is typically how i strncat
 
Hi,
Use "Get New Line Character" BSFN and concat in the end of the line to create a next line..
 
Back
Top