SRL Archive - OSR Help

Result


Dgby714

2010-05-08 00:46:15

Hmm just found out you can use a Result in a function like this

program new;

var
Something: string;

function SayIt: string;
begin
WriteLn(Result);
end;

begin
Something := 'Hi People!';
Something := SayIt;
end.

Its pretty cool =)

I havnt tested to see if it works in SCAR but it worked in Simba

Sex

2010-05-08 01:21:04

Wtf. It seems more like a bug in the interpreter than a feature..

Dgby714

2010-05-08 01:35:40

From: Sex
Wtf. It seems more like a bug in the interpreter than a feature..


Yeah i thought it might be a bug too lol but i like it =)

i luffs yeww

2010-05-08 01:44:31

Wanna check to see if it works in SCAR? :)

Sex

2010-05-08 01:57:21

It would appear so.
Successfully compiled (50 ms)
Hi People!
Successfully executed

i luffs yeww

2010-05-08 02:04:46

Well then it seems as though it's not a bug. Hmm. Interesting. :) Kind of pointless, though.

Sex

2010-05-08 02:08:19

I thought Simba and SCAR both used PS..and PS interprets the shit. So it might be a bug with PS.

i luffs yeww

2010-05-08 03:59:16

Simba uses PS, SCAR uses Delphi (I think). So I doubt it would be a bug?

YoHoJo

2010-05-08 04:10:55

Both use PS. SCAR was just PROGRAMMED in Delphi.
I THINk!?:D

i luffs yeww

2010-05-08 04:14:54

Yeah, I think you're right. But it matters what it was programmed in, I believe.

Quickmarch

2010-05-08 04:17:42

From: i luffs yeww
Yeah, I think you're right. But it matters what it was programmed in, I believe.


Why?

i luffs yeww

2010-05-08 04:18:57

Because the problem/bug/feature would be in Delphi/PascalScript, not SCAR/Simba, right? I don't see how it would be SCAR/Simba's fault.

Quickmarch

2010-05-08 04:53:13

Why would it be Delphi's fault? PS is the interpreter…

Dgby714

2010-05-08 05:29:10

I noticed this when playing with RandStr();

=) found this in srl test it
program new;
{.include SRL/SRL.scar}

var
Test: string;

begin
Test := 'TestString';
Test := AddMistakes('<- Testing', 30);
WriteLn(Test);
end.

also found it in ColorEffectAdd

program new;
{.include SRL/SRL.scar}

var
Test: string;

begin
Test := 'TestString';
Test := ColorEffectAdd(False, True); //Only if color is false and effects is true
WriteLn(Test);
end.

Attached Diff with Fixes =)

Sex

2010-05-08 13:40:32

Yeah, It is a bug man. That's not supposed to happen.

mastaraymond

2010-05-08 19:20:56

Happens with all functions..

program new;
function x : boolean;
begin
end;
var
y : boolean;
begin
y := true;
y := x;
writeln(y);
end.

I guess it's time for everyone to start initializing their results!