On 2005-01-31, Jürgen Schober wrote:
stch_l is a SAS/C function, used to hexadecimal string into a long integer, that's the only thing i could find sofar
I know that :) But I do not want to re-implement it again. I didn't find anything (well, I saw AROS listed the function as implemented), nor do I know what exactly the string format has to be to convert it into dec. I assume something like "0xFF", but could it be, e.g. "$FF" as well ?
No, neither of those. stch_l() only works with strings of hexadecimal _digits_. It converts a string of up to 8 hexadecimal digits to a long value and stored this in the location pointed to by its second argument. The return value from stch_l is the number of digits used in the conversion. stch_l("ff",&l) would return 2 and store 255 in l. stch_l("0xff",&l) would return 1 and store 0 in l. stchl_l("$ff",&l) would return 0 and store 0 in l. Hope this helps. -Peter aka. Archprogrammer Reality is for people who cannot face ScienceFiction. Only lefthanded people are in their right minds.