Welcome, Guest. Please login or register.
Amiga Kit Amiga Store Iridium Banner AMIStore App Store A1200/A600 4xIDE Interface

AuthorTopic: Bug in ARexx + datatypes.library?  (Read 727 times)

0 Members and 1 Guest are viewing this topic.

Offline carls

Bug in ARexx + datatypes.library?
« 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!
Amiga: Too weird to live, too rare to die.
 

Offline patrik

Re: Bug in ARexx + datatypes.library?
« Reply #1 on: December 06, 2004, 04:34:17 AM »
@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
 

Offline nOw2

Re: Bug in ARexx + datatypes.library?
« Reply #2 on: December 06, 2004, 06:33:35 AM »
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" ...
 

Offline carls

Re: Bug in ARexx + datatypes.library?
« Reply #3 on: December 06, 2004, 09:36:24 AM »
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.

Amiga: Too weird to live, too rare to die.
 

Offline Thomas

Re: Bug in ARexx + datatypes.library?
« Reply #4 on: December 06, 2004, 12:49:37 PM »

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

Offline carls

Re: Bug in ARexx + datatypes.library?
« Reply #5 on: December 06, 2004, 02:02:42 PM »
Thomas: Thanks!
I would never have thought of that.
Amiga: Too weird to live, too rare to die.
 

Offline nOw2

Re: Bug in ARexx + datatypes.library?
« Reply #6 on: December 06, 2004, 06:30:45 PM »
Oops, how did I miss the line with the A's in?
I know, it was 7am :)
 

Offline carls

Re: Bug in ARexx + datatypes.library?
« Reply #7 on: December 06, 2004, 10:22:40 PM »
Waddaya know, it works! :)
Amiga: Too weird to live, too rare to die.