SRL Archive - RS3 Help

{$f-} directive


HKbotz

2015-01-21 06:32:35

I noticed that {$f-} is in most, if not all, of the files for the SRL include and I was just curious as to why?
I googled it and found this, but it says it's for compatibility with Turbo Pascal and is used for near/far calls, but has no relevance with 32/64 bit programming, and is ignored. So why are they added with SRL? Do they have a different meaning to Simba or something?

riwu

2015-01-21 06:57:18

It's just to enforce the include developers to use parenthesis when invoking methods (even when there's no parameter).

begin
{$f-}
Simba; //does nothing
Simba(); //works
{$f+}
end.

HKbotz

2015-01-21 08:40:08

Ah ok. It's weird to me to not use parenthesis, but maybe that's cause I come from a C/C++ background lol. Anyway thank you :)

masterBB

2015-01-21 12:52:17

Also function pointers with f- become:

{f-}
[INDENT]ptr := functionname;[/INDENT]


but with f+ it is:

{f+}
[INDENT]ptr := @functionname;[/INDENT]

HKbotz

2015-01-21 13:18:25

From: masterBB
Also function pointers with f- become:

{f-}
[INDENT]ptr := functionname;[/INDENT]


but with f+ it is:

{f+}
[INDENT]ptr := @functionname;[/INDENT]


I haven't messed with any pointers using Simba yet(mostly cause I haven't found the need for the things I've done), but I will keep that in mind. Thanks