Page 1 of 1

Char$() function

Posted: Sat Jan 16, 2010 3:31 pm
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.

Re: Char$() function

Posted: Sat Jan 16, 2010 11:14 pm
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

Re: Char$() function

Posted: Mon Jan 18, 2010 11:01 pm
by Brian Walsh
Thanks for that. It appears that the char$() function is not what I'm after. I'll post another question.

Brian.

Re: Char$() function

Posted: Tue Jan 19, 2010 10:09 am
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

Re: Char$() function

Posted: Wed Jul 04, 2012 11:18 am
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

Re: Char$() function

Posted: Wed Jul 04, 2012 12:55 pm
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

Re: Char$() function

Posted: Thu Jul 05, 2012 11:50 pm
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

Calculations

Posted: Thu Jul 05, 2012 11:55 pm
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

Re: Char$() function

Posted: Fri Jul 06, 2012 10:31 am
by Benj
Hi Brian,

Code: Select all

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

Re: Char$() function

Posted: Fri Jul 06, 2012 1:26 pm
by jollybv
Hi Ben
Thanks this will help me a lot

Brian