PDA

View Full Version : Strings


vijayaraj
05-29-2009, 09:07 AM
Hi all,
I am getting an error which is really cant understand.
This is the following function

def make_address(address):
global a
global b
a = ''
a = a + address[0]
a = a + address[1]
b = a

when i execute this function using STDIN hook,it works really fine.
When i call this function by passing some data to it, it shows the error of follows
Error 13 in make_address @30
Error 4 in make_address @31

also it prints only the first string.

calling function post the correct valid data to the address variable of the called function.despite of this shows error.

can any let knowing what is the exact error?

vijayaraj
05-29-2009, 09:28 AM
Got the answer for it

Jheath
05-29-2009, 09:30 AM
Vijayaraj,


when i execute this function using STDIN hook,it works really fine.
When i call this function by passing some data to it, it shows the error of follows
Error 13 in make_address @30
Error 4 in make_address @31


It appears you might not be passing a proper string when calling the function manually.
Error 13 is an 'invalid subscript' error while Error 4 is an 'incompatible types' error.

The SNAP Reference Manual has a section that describes each of the error codes. Do a search for "errno() – Read and reset latest error code" for full details.

vijayaraj
05-18-2010, 08:51 AM
hi,
I am using PAN4555 module loaded with SNAP.A string variable can store 255 bytes.But Can i know what is the size of the string variable when it is used in the slicing operation.
In case for example it can hold limited say 100 bytes during slicing,if i have string variable say var containing 255 bytes of info each ,whether i can access last 100 bytes ( var[155:255]) ?

Regards,
Raj

Jheath
05-18-2010, 11:03 AM
The max dynamic string size is 62 characters specific to the PAN4555(this limit is different on other platforms). That means you'll need to slice up the larger static string into several smaller strings for processing. Keep in mind that there are only 6 of these strings available.

See the SNAP Reference Manual for more information. Search Freescale MC1321x Chip.

vijayaraj
05-18-2010, 11:43 AM
Keep in mind that there are only 6 of these strings available.
If i am not wrong does the above statement means that only 6 buffers are available for string manipulation?

Thanks,
Raj

Jheath
05-18-2010, 04:25 PM
For the PAN4555 you have the following Dynamic strings to work with.
You can still define static strings...

Number of Tiny Strings: 7
Tiny String Size: up to 8 characters
Number of Medium Strings: 6
Medium String Size: up to 62 characters
Global Variables: 64
Concurrent Local Variables: 64