Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: carls on December 06, 2004, 02:22:32 AM
-
When using datatypes.library's ExamineDT() to a stem, the stem.DataType char can't be used correctly in in comparisons!
For example, if the DataType is "ILBM" I can't do
if stem.DataType="ILBM" then
say "Hello!"
Has anyone else experienced this?
I'm running WB 3.1 on kick 3.0 (yes, I own a 3.1 ROM too but it's in my unused A1200T currently), maybe this has something to do with it?
Here's the complete test code with comments on the output I get: http://gonzo.1av10.nu/testdt.rx
Any help would be greatly appreciated!
-
@carls:
I ran the script on an iff-picture on my 3.1/3.1 system and the results were the same as yours - it neither said "Hello" nor "Hello 2".
/Patrik
-
OS 3.9:
> rx testdt.rx
[ILBM]
CHAR
Hello
CHAR
AILBMA
Hello 2
--
Perhaps it's putting spaces in incorrectly under 3.1? Try:
say "("|| dt_string || ")"
if left(dt_string,6)="AILBMA" ...
-
Thanks for testing it guys!
nOw2:
I don't think so; I'm adding "A" to both sides of the value and no spaces appear, when I print the value encapsulated by brackets there no extra spaces appear either. I'll try using left() though, that should at least return a proper variable. I hope. :)
I should probably test it using datatypes.library from Workbench 3.0 and see what happens. Perhaps there's a bug in the 3.1 version.
-
Well, what you didn't do is to look what is really in this string. A say c2x(dt.datatype) revealed that there is a trailing binary zero: 494C424D00
The command dt.datatype = strip(dt.datatype,,'00'x) corrects the error (and it still runs on OS3.9).
Bye,
Thomas
-
Thomas: Thanks!
I would never have thought of that.
-
Oops, how did I miss the line with the A's in?
I know, it was 7am :)
-
Waddaya know, it works! :)