Small Basic Known Issue: 23589 - Controls.GetTextBoxText() Returns CR+LF as Newline from Multi-Line Text Box in Local but CR in Remote

Introduction

Series of know issues articles are showing known issue itself about Small Basic and it's workaround. In this article, local means Small Basic IDE environment and remote means smallbasic.com/program/?<id> environment with internet browser and Silverlight add-in.

Phenomenon

Returned text by Controls.GetTextBoxText() contains CR+LF as newline from multi-line text box in local.  But CR in remote.  CR means carriage return.  LF means line feed.

CR = Text.CharacterCode(13)
LF = Text.CharacterCode(10)

Workaround

Allow both CR+LF and CR for newline.

Sample Programs

Repro Program

KPS036-0 can reproduce this issue.  Enter multi-line text into multi-line text box and push [Dump] button. In local you can see 000D 000A as newline, but in remote you can see only 000D as newline.

Workaround

VCP992 is a sample to convert multi-line text to array of lines.  Original program is listed in following article and the original doesn't work properly in remote.

Small Basic: How to Convert Multi-Line Text into an Array of Lines

See Also

Small Basic: Difference Between Local and Remote