Marcel reckons word length, I suppose checking the byte just before the string should see that. If that fails, check the two bytes before the string in both orders (intels and motorola-isms), if that fails find the LF after the string? Or is that overkill?> Do all programs have a word length counter before the device name or > do some have a byte length one? And any programs known to use a device > name delimited by LF or whatever rather than the internal format with > length word/byte?
Good question - normally a word length. What about inside a C program (remembering that C expects strings to end with a 0 byte and not have a word length..... ??
Also:
Thanks, Joachim, I shall gather various type sof programs to throw at this and find out by trial and error how it works.C does not use a length, in C the string is null terminated (so a null byte after the string, no easy way to figure out what the beginning of the string is. What about tokenized basic, or compiled basic? In SBasic (in some places at least), string length is indicated with a byte.
Do you think the program should have a batch conversion mode as well, or do you think it's better doing just one program conversion at a time? Certainly easier to write to handle one named program at a time.
Not overkill think it should be like this - especially to take into account the C program format - isn't there a standard header at the start of C programs to identify them?? Don't think you need to worry about the string being followed by LF - especially as this could actually be part of a string.
Hmm - just thought - if you allow for C strings, you need to ensure that the character BEFORE the SER or PAR is not another letter, eg we could replace a prompt: "Print to (SER)", but not "You are a loser" (both would end with byte 0.
And yes, Joachim is correct - you do also need to be able to handle the byte length format. Fairly easy to program - check if the word length<6 (?) if not, is the byte length<6.
-- Rich Mellor RWAP Services 26 Oak Road, Shelfield, Walsall, West Midlands WS4 1RQ
http://www.rwapservices.co.uk/
_______________________________________________ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm
