SRL Archive - Bugs

SetScriptProp Returning False


LolL

2011-08-25 22:34:37

When using SetScriptProp(SP_OnTerminate, ['…']); the function returns true as expected. However, when using SetScriptProp(SP_WriteTimeStamp, [True]); the function returns false even though it does turn the time stamp feature on.

i luffs yeww

2011-08-26 00:16:19

I may have found the problem.. Just getting lazarus so I can build it and make sure it works as expected.

;< dumb Lazarus. I can't seem to build Simba (I know it's my fault :p), but I do believe I know what the problem is. Trying to get in touch with Wizzup or Dgby to either have them build it or help me with it.

Gu3st...

2011-08-26 02:05:56

From: i luffs yeww
I may have found the problem.. Just getting lazarus so I can build it and make sure it works as expected.

;< dumb Lazarus. I can't seem to build Simba (I know it's my fault :p), but I do believe I know what the problem is. Trying to get in touch with Wizzup or Dgby to either have them build it or help me with it.
What about posting what and where the bug is?

i luffs yeww

2011-08-26 02:23:26

Well I was going to just send a pull request but I couldn't build it to try it out, so Dgby tested it and changed the functionality, which I don't like.

Isn't too hard to find, but it's in /home/ian/mahsheet/Simba/Units/MMLAddon/scriptproperties.pas, function TScriptProperties.SetProp (line 119 ish). The reason it wasn't working (I think) was due to..


SP_WriteTimeStamp : begin
if length(Value) <> 1 then
begin
mDebugLn('SP_WriteTimeStamp only needs 1 value in the array');
exit;
end;
try
if Value[0] = True then //from here to..
FProperties := FProperties + [Prop]
else
FProperties := FProperties - [Prop]; //here
except
mDebugLn('Could not convert your value passed to SetProp');
end;
end;

as you can see, the result is never set to true. Not sure if that will fix is problem, but I changed it to..


SP_WriteTimeStamp : begin
if length(Value) <> 1 then
begin
mDebugLn('SP_WriteTimeStamp only needs 1 value in the array');
exit;
end;
try
if Value[0] = True then
begin
FProperties := FProperties + [Prop];
Result := True;
end
else
FProperties := FProperties - [Prop];
except
mDebugLn('Could not convert your value passed to SetProp');
end;
end;

Anyway, if that's not the problem, it should be somewhere in that file, maybe.