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 / Dynamic code execution?

Author
Message
bigtunacan
8
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 28th Jul 2015 03:14
Is there a way to execute code dynamically from a string within AGK2?

This is a contrived example, but in JavaScript I could do something like this.



In GLBasic I could use CALLBYNAME

http://www.glbasic.com/xmlhelp.php?lang=en&id=243&action=view

Some equivalent of this in AppGameKit is what I'm looking for.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Jul 2015 11:23
not that i know in tier1 basic but you can make a select case.



AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 31st Jul 2015 17:11 Edited at: 31st Jul 2015 17:12
I like that idea too.
Recently I asked for something like this in the v2 Feature Requests Thread.

But it is unlikely that we get it because you can bypass AppGameKit with it, not?

Until we get that feature, you must stay with Markus's suggestion.
Or #constants if you just need shortcuts for functions.


Using AGKv2 Tier1
bigtunacan
8
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 31st Jul 2015 18:24
I think a true eval would be difficult since AppGameKit is compiled and eval must be interpreted, but something like GLBasic's
works for most of the things I would want and should be doable. I'm trying to avoid huge select statements like Markus suggests as they just muddy the code IMHO.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Aug 2015 00:30
i think paul is still mia because kickstarter...
but agree this call by name will be a good feature.

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-04-26 08:42:52
Your offset time is: 2024-04-26 08:42:52