IonicWind Software

IWBasic => General Questions => Topic started by: Brian on August 13, 2011, 04:12:50 AM

Title: ISTRING
Post by: Brian on August 13, 2011, 04:12:50 AM
Hi,

Just realised I had an ISTRING defined, but no amount assigned, ie, ISTRING renewalDate,
when it should have been ISTRING renewalDate[16]

It didn't convert the string as it should have until I defined an amount there

So the question is: What amount would have been allocated when it was defined wrongly,
if at all, and why didn't the compiler pick up the error?

Brian
Title: Re: ISTRING
Post by: LarryMc on August 13, 2011, 06:50:07 AM
I did a little playing and it appears it doesn't allocate any 'default' size which is what I would expect.

I also verified there is no warning.  Sapero will need to look into it.

LarryMc
Title: Re: ISTRING
Post by: billhsln on August 13, 2011, 09:49:02 AM
New 'Feature' or minor bug?

Bill
Title: Re: ISTRING
Post by: sapero on August 13, 2011, 09:59:28 AM
That was just an unhandled exception. The size of buffer should be zero, and you should be not able to assign any string to it, since the parser has implemented some extra security for strings, used each time you assign an string to a variable which size is known at compile time.

Added a warning and assumed [255] characters - the default size of an string. (Updated also IWSTRING)
This update will be available after LarryS rebuilds and uploads the setup file.
Title: Re: ISTRING
Post by: Brian on August 13, 2011, 10:26:36 AM
Thanks, Sapero,

It was no biggie, and was easy to find once I knew the variable was empty

Brian