SRL Archive - OSR Help

Probably A Stupid Question Regarding Functions


kaiman299

2011-12-29 04:36:45

This is probably a horrible question, but when writing a script, if you write a line such as:

function ClickMusician: boolean;

Does ClickMusician call upon a function from SRL, or is it just the arbitrary name of whatever you're writing?

Hopefully this isn't too much of a "duh", I just have a hard time now knowing why things work.

YoHoJo

2011-12-29 04:43:43

You can name your procedures and functions whatever you wish (as long as they are not the same as a procedure or function in SRL).

They will only 'call upon' and use whatever you put between the begin/end after them.

function ClickMusician: boolean;
Begin
Wait(100);
End;
Would not even need you to include SRL, but

function ClickMusician: boolean;
Begin
If FindObj(bla) Then
Begin
Result:=True;
Writeln('We Found Him');
End;
End;

would 'call upon' SRL for using the FindObj function coded into SRL.

All good and answered?

kaiman299

2011-12-29 04:44:35

Fantastic, thanks for the quick response. I'm actually watching your tutorial right now, just making sure I understand everything fully. Thanks again!

YoHoJo

2011-12-29 04:45:31

Yup Yup! Enjoy those glad I could help!