Carriage Return Line Feed

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Brian Walsh
Posts: 29
Joined: Thu Jan 14, 2010 10:43 pm
Has thanked: 3 times

Carriage Return Line Feed

Post by Brian Walsh »

I want to append a carriage return (ASCII 13) and line feed (ASCII 10) to a string.

My variable is as follows:

string = "hello world"

Could someone please show me the syntax to add the two control characters.

Brian.

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: Carriage Return Line Feed

Post by Sean »

Hello Brian,

One way to add carriage return and line feed to a string is to make a string containing only these characters, and add it to any other string as required. This process allows Flowcode to maintain correct control of the lengths of the strings involved.

First, use a string block to create a string called CrLf and initialise it with a 2 character string, eg. "xx".

Next, use a calculation block to access the string as an array and change the two characters to the unprintable CR and LF values:

CrLf[0] = 0x0d
CrLf[1] = 0x0a

The CrLf string can then be used in Flowcode string blocks to add the characters to other strings.

Post Reply