SRL Archive - RS3 Help

Help with productionScreen


SlipperyPickle

2015-01-18 07:48:58

Hi,

When I use this:

if (productionScreen._getSelectedBox() <> 1) then
productionScreen.selectBox(1);

I get an error: "Error: No default value for parameter 1 found at line 79".

What am I doing wrong? Can't figure it out.

Thanks in advance!

Clarity

2015-01-18 07:53:02

From: Suikerwafel
Hi,

When I use this:

if (productionScreen._getSelectedBox() <> 1) then
productionScreen.selectBox(1);

I get an error: "Error: No default value for parameter 1 found at line 79".

What am I doing wrong? Can't figure it out.

Thanks in advance!

What line is line 79?

riwu

2015-01-18 07:55:02

function TRSProductionScreen._getSelectedBox(slot: Integer): Integer;
It has a slot parameter and you didnt pass any argument to the function, hence the error.
Anyway i believe that all functions that start with underscore are meant to be private/internal functions that u shouldn't use.
Just do
if productionScreen.selectBox(1) then
directly.

SlipperyPickle

2015-01-18 07:55:19

From: Clarity
What line is line 79?


Sorry for not adding this. Line 79 is: "if (productionScreen._getSelectedBox() <> 1) then"

Clarity

2015-01-18 07:58:04

From: Suikerwafel
Sorry for not adding this. Line 79 is: "if (productionScreen._getSelectedBox() <> 1) then"

From the include file:
function TRSProductionScreen._getSelectedBox(slot: Integer): Integer;
You need an integer parameter in productionScreen._getSelectedBox();
productionScreen._getSelectedBox(slotNumberHere);

SlipperyPickle

2015-01-18 07:59:25

From: riwu
function TRSProductionScreen._getSelectedBox(slot: Integer): Integer;
It has a slot parameter and you didnt pass any argument to the function, hence the error.
Anyway i believe that all functions that start with underscore are meant to be private/internal functions that u shouldn't use.
Just do
if productionScreen.selectBox(1) then
directly.


Thanks, I just found out what it is. When using "productionScreen.selectBox(1)" it automatically checks if it is already checked. When it's checked it won't be checked again. (A lot off "checks" in one sentence :P)

KeepBotting

2015-01-18 08:44:26

From: Suikerwafel
Thanks, I just found out what it is. When using "productionScreen.selectBox(1)" it automatically checks if it is already checked. When it's checked it won't be checked again. (A lot off "checks" in one sentence :P)


Generally, routines with a single-underscore (._getSelectedBox) should (probably) only be used by the include. So if you come across a single-underscored function, chances are that there's actually a better function that calls that function. If that makes any sense.