NER line breaks

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?
 

johndanter

Legendary Poster
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:

BOster

Legendary Poster
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)
 

nkuebelbeck

VIP Member
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
 
Top