GoPinball.com
http://www.gopinball.com/forum/

"Call" function to jump to a sub
http://www.gopinball.com/forum/viewtopic.php?f=55&t=8513
Page 1 of 1

Author:  zobou [ Wed Jan 30, 2019 10:20 pm ]
Post subject:  "Call" function to jump to a sub

Hello, I wanted to share a very practical thing to avoid repeating code unnecessarily.
In this way, you can introduce a specific function between sub and end sub and reuse it several times with the "Call"

Here is a simple example,

Code:
Sub test()
AddDebugText "Test ok"
End sub

' The Method Is Called Immediately the Game Engine is Ready to
' Start Processing the Script.

Sub FuturePinball_BeginPlay()
Call test
End Sub


Author:  Popotte [ Thu Jan 31, 2019 2:16 am ]
Post subject:  Re: "Call" function to jump to a sub

Or more simple:
Sub Test(Texte)
AddDebugText Texte
End sub

' The Method Is Called Immediately the Game Engine is Ready to
' Start Processing the Script.

Sub FuturePinball_BeginPlay()
Test "Test OK"
End Sub

Author:  zobou [ Thu Jan 31, 2019 11:26 pm ]
Post subject:  Re: "Call" function to jump to a sub

You can deleter yourself post, just ridiculous that I did not light up before. lol

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/