Strange behavior of EditorGadget on CrCrLf-sequence
Posted: Sat Aug 12, 2006 10:29 pm
I noticed the sequence of two carriage return characters followed by a linefeed character is shown as a space character instead of line breaks in an EditorGadget. In a TextGadget the same sequence results in 3 line breaks.
Sample code:
Will output:
This sequence is used by certain DOS commands like IPconfig, from which I would like to capture the output with ReadProgramString and display it in a gadget. Ofcourse I can replace the sequence with a carriage return as a workaround but it would be nice to know what's going on. Any explanantion?
(I'm using PB4.00)
Thanks,
Geert
Sample code:
Code: Select all
If OpenWindow(0, 0, 0, 150, 100, "", #PB_Window_SystemMenu )
CreateGadgetList(WindowID(0))
varTextGadgetID = EditorGadget(#PB_Any, 3, 3, 140, 90, #PB_Editor_ReadOnly)
AddGadgetItem(varTextGadgetID, -1, "Test-CR" + #CR$ + "Test-LF" + #LF$ + "Test-CRLF" + #CRLF$ + "Test-CRCRLF" + #CR$ + #CRLF$ + "." + "No newline?")
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Code: Select all
Test-CR
Test-LF
Test-CRLF
Test-CRCRLF .No newline?
(I'm using PB4.00)
Thanks,
Geert