error in online help: "#13" instead of "Chr(13)"

General discussion on mikroBasic PRO for AVR.
Post Reply
Author
Message
reb
Posts: 5
Joined: 14 Dec 2016 00:45

error in online help: "#13" instead of "Chr(13)"

#1 Post by reb » 19 Jan 2017 17:35

hi,

in the online help is stated:

String Concatenating
"For control characters, use the non-quoted hash sign and a numeral (e.g. #13 for CR)."

this is wrong:
use "+ Chr(13)" etc. instead.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: error in online help: "#13" instead of "Chr(13)"

#2 Post by filip » 08 Feb 2017 10:01

Hi,

Thank you for reporting this, we will fix it.

Regards,
Filip.

RichD
Posts: 6
Joined: 13 Feb 2018 12:17

Re: error in online help: "#13" instead of "Chr(13)"

#3 Post by RichD » 23 Mar 2018 17:36

I seem to be struggling here too.
I need a string that contains only the ascii value 13 (a CR)
so I dimension a string - say CR_str
then I try CR_str=chr(13)
but I get an 'incompatibe types' error.
Obviously I'm mis understanding the use of 'chr'.
It seems the type expected is a byte.
so if I dimension X1 as byte
x1=chr(13) compiles ok, leaving x1=13
interesting but not what I need, and it does seem to make 'chr' a rather useless instruction, x1=13 would be a little easier so I must be missing something.
So what am I doing wrong here?
What is the easiest way to get a string containing a control characters or a combination of printable and control characters?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: error in online help: "#13" instead of "Chr(13)"

#4 Post by filip » 27 Mar 2018 14:22

Hi,
I need a string that contains only the ascii value 13 (a CR)
Try the following code :

Code: Select all

dim CR_String as string[1]
...
CR_String[0] = Chr(13)
Regards,
Filip

Post Reply

Return to “mikroBasic PRO for AVR General”