Register    Login    Forum    FAQ    PinSimDB.org

Board index » Resources » Tutorials, how-to's, bug report and docs




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: "Call" function to jump to a sub
 Post Posted: Wed Jan 30, 2019 10:20 pm 
Offline

Joined: Mon May 08, 2017 12:41 pm
Posts: 11
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



Top 
 Profile  
 
 Post subject: Re: "Call" function to jump to a sub
 Post Posted: Thu Jan 31, 2019 2:16 am 
Offline
User avatar

Joined: Fri Jul 02, 2010 4:50 am
Posts: 1154
Location: Paris - France
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

_________________
Les cons ça ose tout. C'est même à  ça qu'on les reconnaît.
My tables avalaible at http://www.pinsimdb.org/fpreleases/ and http://www.irpinball.org/
Image
Image
Le prix s'oublie, la qualité reste


Top 
 Profile  
 
 Post subject: Re: "Call" function to jump to a sub
 Post Posted: Thu Jan 31, 2019 11:26 pm 
Offline

Joined: Mon May 08, 2017 12:41 pm
Posts: 11
You can deleter yourself post, just ridiculous that I did not light up before. lol


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 3 posts ] 

Board index » Resources » Tutorials, how-to's, bug report and docs


Who is online

Users browsing this forum: No registered users and 5 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron