Char$() function
Moderator: Benj
-
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
- Contact:
Char$() function
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.
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.
-
- 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
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
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
-
- Posts: 29
- Joined: Thu Jan 14, 2010 10:43 pm
- Has thanked: 3 times
- Contact:
Re: Char$() function
Thanks for that. It appears that the char$() function is not what I'm after. I'll post another question.
Brian.
Brian.
- 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
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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
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
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
- 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
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:
Cheers,
Jonny
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)
Jonny
- 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
Thanks guys i understand nowJonnyW 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:Cheers,Code: Select all
value = Char$(buffer, 0) text = ToString$(value)
Jonny
- 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
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
Just a quick question is it possible to say in a decision for example bigger than 10 but smaller than 100
Regards
Brian
- 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
Hi Brian,
Code: Select all
(var > 10) && (var < 100)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel