The online racing simulator
[Solved] Help with opening a Sub callback
Hello its me again, PepinoSmile

i am getting stupid atm erm, i cannot open a Sub with "br_Fixtures( $KeyFlags,$id )"?
used it at Sub br_fixture_right( $KeyFlags,$id ) do i wrote it wrong or is it completely incorrect ?
Thanks againSmile

Sub br_Fixtures( $KeyFlags,$id )
closePrivButton( "br_fixture_Head&br_fixture_right&br_1fixture&br_fixture_left2&br_fixture_right2&br_1fixture2");
openPrivButton( "br_fixture_Head",65,46,70,13,5,-1,0,"^0Fixture List - Season 2017");
openPrivButton( "br_fixture_right",70,165,70,13,5,-1,0,"^7^r",br_fixture_right);
openPrivButton( "br_1fixture",58,62,100,5,6,-1,68,"^0Test1%nl%Test2");
EndSub

Sub br_fixture_right( $KeyFlags,$id )
closePrivButton( "br_fixture_Head&br_fixture_right&br_1fixture&br_fixture_left2&br_fixture_right2&br_1fixture2");
openPrivButton( "br_fixture_left2",60,165,70,13,5,-1,0,"^7^l",br_fixture_left2);
openPrivButton( "br_fixture_right2",70,165,70,13,5,-1,0,"^7^r",br_fixture_right2);
openPrivButton( "br_1fixture2",58,62,100,5,6,-1,68,"^0Test3%nl%test4");
br_Fixtures( $KeyFlags,$id )
EndSub
The most obvious thing that jumps out, is that you've not put a semi-colon ";" at the end of the line that calls the br_Fixtures sub (in your 2nd sub).

Add it to your 2nd last line and see how you get on.

A way to sometimes find errors is to look at the text file that ends -ERR.log within your default/logs directory. Usually, you'll be given the line number within the script add-on where the fault lies. Weirdly, in the case of a missing semi-colon, sometimes the line number will be given as the next line WITH a semi-colon, and you have to work backwards to find a line that doesn't have one.
what a little mistake could do!
wrote yesterday to much, i couldnt find it but i was sure it was on one of the 2 sub's.

Thank you alot sinanju!
openPrivButton( "br_fixture_leftt",60,165,70,13,5,-1,0,"^7^l",br_fixture_leftt);

Sub br_fixture_leftt( $KeyFlags,$id )
closePrivButton( "br_text2&br_fixture_right&br_fixture_left2&br_fixture_Head&br_1fixture&br_fixture_right2&br_1fixture2");
br_Fixtures( $KeyFlags,$id );
EndSub

right a another problem... th openPrivButton above is ona Sub and works, but the Sub br_fixture_leftt does nothing. Why dont it close any buttons or open the br_Fixtures?

and openPricButton("br_fixture_right" etc etc it does!
Create a "debug" message in the 'br_fixture_leftt' Sub. To see if the sub is actually working. If not , there might be a chance that the Parameters of that sub are wrong.
Check the errorfiles instead.

If the sub must open from a Clickable button, then this should be working.
Otherwise from a command:

CASE "!btn":
br_fixture_leftt($KeyFlags);
BREAK;

Sub br_fixture_leftt($KeyFlags)
EndSub

or

CASE "!btn":
br_fixture_leftt($userName);
BREAK;

Sub br_fixture_leftt($userName)
EndSub

Its sorted ! thank you guysSmile
Could you explain what you have done to fix this issue. Your fix could help some other lapperusers aswell.
ah yeah sure erm

ive wrote that when you click the button, it opens the Sub br_Fixtures instead of br_Fixture_Left (the left arrow)

example we are on the side Fixtures2 and with the left arrow we are going to Fixtures(1) and with the right arrow we are going to the side Fixtures3 instead of making another Sub, saves space.

openPrivButton( "br_Left2",88,165,13,13,6,-1,0,"^7^l",br_Fixtures);

openPrivButton( "br_Right2",98,165,13,13,6,-1,0,"^7^r",br_Fixtures3);
This thread is closed

[Solved] Help with opening a Sub callback
(8 posts, closed, started )
FGED GREDG RDFGDR GSFDG