Char$() function

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
Contact:

Char$() function

Post by Brian Walsh »

I'm completely new to this, so sorry in advance for the dumb nature of the question.

Details of the Char$() function are missing from the help file, so I assumed that the decimal value of the required ASCII character goes between the brackets.

I have a working program which has a variable: string = "hello world ".

When I go into the properties of the string manipulation box and edit it to: string = "hello world " + Char$(13) + Char$(10) I get a syntax error.

Any help greatly appreciated.

Brian.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Char$() function

Post by medelec35 »

I believe the Char$() function is used to produce a numeric value from a string variable.
E.g
String = "hello world"
Num = Char$(string, 2)

This would assign variable Num (numeric variable) with the value of 108 since ASCII Dec value of l is 108.

I know the LCD has a function to display ASCII characters.

You can find some information here:
http://www.matrixmultimedia.com/mmforum ... 50&p=14733
Martin

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

Re: Char$() function

Post by Brian Walsh »

Thanks for that. It appears that the char$() function is not what I'm after. I'll post another question.

Brian.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Char$() function

Post by Benj »

Hello Brian

You should be able to do this to acheive what you are trying to do.

Variables
string1[20]
string2[2]

Calculation
string2[0] = 13
string2[1] = 10

String Manipulation
string1 = "Hello World" + string2

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Char$() function

Post by jollybv »

Hi Guys
I am sending a Char ($) and when i revive this Char i need to turn it into its No 36 i am not sure how to do this is there a string manipulation i should use??? :?

Regards
Brian

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Char$() function

Post by JonnyW »

Hi. I believe (topically enough) that Char$(string, index) is what you want. This pulls the character out and returns it as its ASCII value.

If you want to print this number to some output (convert it to text) use the ToString$() function:

Code: Select all

value = Char$(buffer, 0)
text = ToString$(value)
Cheers,

Jonny

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Char$() function

Post by jollybv »

JonnyW wrote:Hi. I believe (topically enough) that Char$(string, index) is what you want. This pulls the character out and returns it as its ASCII value.

If you want to print this number to some output (convert it to text) use the ToString$() function:

Code: Select all

value = Char$(buffer, 0)
text = ToString$(value)
Cheers,

Jonny
Thanks guys i understand now

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Calculations

Post by jollybv »

Hi guys

Just a quick question is it possible to say in a decision for example bigger than 10 but smaller than 100 :?:

Regards
Brian

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Char$() function

Post by Benj »

Hi Brian,

Code: Select all

(var > 10) && (var < 100)

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Char$() function

Post by jollybv »

Hi Ben
Thanks this will help me a lot

Brian

Post Reply