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 Studio Chat / [SOLVED] AGK function declaration format ?

Author
Message
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 15th Aug 2024 05:42

Howdy ALL,

Writing a tool that scan through a cross section of languages (BASIC's mainly ) include AGK/AGKS and was wondering if there's any function declaration variations I need to be aware of ??

is the file extension for these source codes ".agc" always ? or is there any variation ?

I know a function is declared, but are there any variation shortcuts in the syntax ?



For example; Does it support End Function as well as EndFunction ? like Dark BASIC / Dark BASIC Pro


What are the common characters and comment blocks ??

; comment
// comment

rem comment single line

/*
multi line comment block

*/

remstart / remend ?


I think that about covers it; I've a few AppGameKit test codes but if there's something you think I need to test with post a link bellow !


Later dudes !

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code

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

Go to answer

Virtual Nomad
Moderator
19
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 15th Aug 2024 07:34 Edited at: 15th Aug 2024 08:37
This post has been marked by the post author as the answer.
off the top of my (pointed) head:

End Function won't work where End is a thing on its own while it will error in the expectation that you are going on to declare a Function in the same line.

with that, unlike DBPro, all AppGameKit commands are a single word (that took some getting used to but i love it now) which i believe is without exception.

then, consider ExitFunction, as well? and, not sure how exhaustive you're intending to be but there is also variety in acceptable function parameters including REF.

otherwise, ` (grave accent, ASCII Code 96) can be used to REM (a single line) as well (i use it all the time, unfortunately, as it's quick but easy to overlook when reviewing code).

hope that helps
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 16th Aug 2024 16:25

Thank VN,

That seems to cover everything at the moment. Don't need to parse the arguments or exit function for now, just locating the code block and output them.

Just need some bigger example to test it on..

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code
blink0k
Moderator
12
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 21st Aug 2024 21:54
Some code. You also have a ton of code in the samples delivered with AGK

Attachments

Login to view attachments
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 23rd Aug 2024 03:33

Thanks Blink,

Test and working correctly..

PlayBASIC To HTML5/WEB - Convert PlayBASIC To Machine Code

Login to post a reply

Server time is: 2025-05-13 02:04:36
Your offset time is: 2025-05-13 02:04:36