Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] How can i return a data from a function?

Author
Message
REvenge_gamES
2
Years of Service
User Offline
Joined: 13th May 2021
Location: Chile
Posted: 13th May 2021 14:02
This post has been marked by the post author as the answer.
i want to create a function that returns the number of the center of the screen:


but the compiler says:
main.agc:21: error: Unexpected token "center", RETURN must be followed by a new line

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th May 2021 18:08 Edited at: 14th May 2021 18:12
sorry, i deleted your thread. i meant to delete the initial post and keep the edit.

i asked that it be re-instated and here we are:

i hope this answers your Q:

see User Defined Functions 1/2-way down the help page.

also, note proper use of Return.
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 14th May 2021 21:18
a function return in AppGameKit is ExitFunction, the return keyword is used to exit a GoSub

Login to post a reply

Server time is: 2024-04-25 05:39:59
Your offset time is: 2024-04-25 05:39:59