Code: Select all
UART1_Write_Text("hello RS232")
Code: Select all
const _hello = "hello RS232"
dim text as string[11]
text = _hello
UART1_Write_Text(text]
Cheers
Alex
#1 Post by alexconway » 18 Sep 2012 22:39
Code: Select all
UART1_Write_Text("hello RS232")
Code: Select all
const _hello = "hello RS232"
dim text as string[11]
text = _hello
UART1_Write_Text(text]
#2 Post by janni » 19 Sep 2012 01:05
Code: Select all
dim text as string[11]
text = "hello RS232"
UART1_Write_Text(text)
#3 Post by alexconway » 19 Sep 2012 15:19
#4 Post by janni » 19 Sep 2012 18:07
No . I just explained where the difference comes from. I have formulated no opinion about which method is better as they both have their uses.alexconway wrote:would you have anwered differently if I had used a longer string?
Well, no compiler is ideal and there are ways to optimize code/RAM space for every compiler. On average, programmers bloat code much more effectively then compilers .By moving the literal string into a const, it feels like I am doing work that the compiler could be doing for me!
#5 Post by oliverb » 16 Jun 2014 12:43
Return to “mikroBasic PRO for PIC Wish List”