Font_ScanString bug
Chris Hall (132) 3558 posts |
I am getting an abort on data transfer when I try to scan a multi-line string, in fact a string which is being used as the text which fills a text area object to make sure the column height is sufficient to encompass the string:
what is going on please? |
Chris Hall (132) 3558 posts |
Have decided it is simpler to scan each paragraph to detect width and work out how many line breaks it requires and just add them up – i.e. don’t venture into multi-line stuff at all. But I still think a valid OS call should not abort. That method seems to work OK. |
Sprow (202) 1158 posts |
What on earth are you doing there? The flags say you’re passing the spacing/split/bbox in R5, but R5 contains &7FFFFFFF. Definitely some user register jumblage going on.
It’s not valid. |
Rick Murray (539) 13850 posts |
Many parts of RISC OS will act badly on invalid input. So if something that unexpected happens, the first port of call should be to examine carefully the parameters being passed.
In cases like this, I prefer to use binary notation (like %010101…) or build the value in parts (like (3<<16)+(1<<22) ) because this makes it much clearer what is being attempted. Your flags are %1000000000000100000, or bit 5 and bit 18. This means to use R5 as coordinate block on entry, bounding box on exit. Thus, as Sprow points out, &7FFFFFFF is an invalid address and the reason for the abort. There are two commas after the &040020.Remove one of them, that should put things in the right places, assuming that &287EE and &7FFFFFFF are the width/height remaining on the current line (in millipoints)… |
Chris Hall (132) 3558 posts |
There are two commas after the &040020.Remove one of them, that should put things in the right places, assuming that &287EE and &7FFFFFFF are the width/height remaining on the current line (in millipoints)… Many thanks – I feel rather embarrassed they are width/height (whether in Draw units or millipoints I can’t remember but I’ll check they are millipoints), ‘tem%’ is indeed intended for R5 and I seem to have put in one too many commas! I’ll try again. |