Page 2 of 2

Re: Strings

Posted: Wed Feb 23, 2011 5:47 pm
by medelec35
Hi Brian,
There is a int to string function within the functions of String Manipulation macro
int to string.png
(57.23 KiB) Downloaded 14466 times
See attached Flowchart.

Re: Strings

Posted: Wed Feb 23, 2011 6:37 pm
by jollybv
Hey guys

Dont worry found out how to do it :P

Re: Strings

Posted: Fri Feb 25, 2011 5:37 am
by jollybv
Hi Guys

One quick thing i am trying to use the (receive string) component and it keeps giving me an error "The index you entered is outside the limits of the array"
nTimeout(BYTE),NumBytes(BYTE) = 50,4 and string Var= string[4] what am i typing in wrong??? Could you also please explain what I'm doing wrong as i go into properties in FlowCode 4 click on the RS232 component then click on help and nothing comes up. maybe i to new to flowcod 4 or just being stupid

Brian

Re: Strings

Posted: Fri Feb 25, 2011 9:52 am
by Benj
Hello Brian,

Please can you post our Flowcode program and I will have a look for you.

To get help working on Windows 7 or Vista you need to follow this FAQ topic.
http://www.matrixmultimedia.com/support ... f=31&t=606

Re: Strings

Posted: Fri Feb 25, 2011 3:39 pm
by Spanish_dude
This error happens when you go "outside the limits of the array". A little example will explain it all:

Code: Select all

char some_string[10] = {0};
Okay, so I declared a string/array of 10 characters.
The index of the array starts at 0 and goes up to 9, so if you do something like :

Code: Select all

some_string[10] = 'A';
This will give you an error "outside the limits of the array", as 10 (and higher) isn't a right index to write into the array.
You are trying to access some memory that isn't initialized (so the value of it is a random number from 0 to 255) and this could give you some weird behaviors, if executed.

Re: Strings

Posted: Tue Mar 22, 2011 5:45 am
by jollybv
jollybv wrote:Hi Guys

Is there anyone out there who can show me how turn an "Int" back into a "string"

Brian

Re: Strings

Posted: Tue Mar 22, 2011 8:06 am
by medelec35
Hi Brian,
With Flowcode V3 or Flowcode V4, the 6th post up shows you how to convert a int to a string.
Did that not work for you?

Martin

Re: Strings

Posted: Thu Jul 12, 2012 5:55 pm
by jollybv
Hi guys

I am having a small problem with Interrupts and strings i have attached a small demo to show, in the main program i enable the interrupt THR0 and tell it to call a Macro that has a receive char in it it is looking for Char ^ (94) so when it sees this char it must jump in and out of setup which all works, now my problem is if I send a string say for example 001 the receive char in the interrupt gets the first 0 and the receive string gets 01 could you please tell me if there is a better way of doing this or how to sole this problem

Brian

Re: Strings

Posted: Sat Jul 14, 2012 3:24 am
by Enamul
Hi Brian,
in the main program i enable the interrupt TMR0 and tell it to call a Macro that has a receive char in it it is looking for Char ^ (94) so when it sees this char it must jump in and out of setup which all works, now my problem is if I send a string say for example 001 the receive char in the interrupt gets the first 0 and the receive string gets 01
This is happening because you are using TMR0 for interrupt which triggers very fast so when you are trying to read "^", then it works fine but when you try to read "001", reading this three strings takes time by this time TMR0 triggers as well that's why you are getting the result.

I have modified your code and remove TMR0 to avoid the problem...you can now check whether it works or not..

Enamul

Re: Strings

Posted: Sat Jul 14, 2012 7:58 am
by jollybv
Enamul wrote:Hi Brian,
in the main program i enable the interrupt TMR0 and tell it to call a Macro that has a receive char in it it is looking for Char ^ (94) so when it sees this char it must jump in and out of setup which all works, now my problem is if I send a string say for example 001 the receive char in the interrupt gets the first 0 and the receive string gets 01
This is happening because you are using TMR0 for interrupt which triggers very fast so when you are trying to read "^", then it works fine but when you try to read "001", reading this three strings takes time by this time TMR0 triggers as well that's why you are getting the result.

I have modified your code and remove TMR0 to avoid the problem...you can now check whether it works or not..

Enamul
Thanks Enamul

This simple bit of code will help me tremendously as I have been battling for over a week to do this

Brian

Re: Strings

Posted: Sat Jul 14, 2012 10:47 am
by Enamul
It's nice to hear that the code helped you. :)

Re: Strings

Posted: Fri Oct 30, 2015 11:32 am
by jollybv
Hi Guys

I was wondering would like to work out the length of a certain value in a string e.g. I have a long string and in side is this value Airtime balance is R0.00. " 15 and then lots of nonsense after it. This can change to Airtime balance is R1999.00 or anything inbetween. I would like to no if i can work out the length of the R0.00 or R1999.00 in the string so that i can do string manipulation on it