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 / Spaces in command names

Author
Message
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 17th Feb 2011 01:28
No white-space in commands please, extra garlic and a side of fries to go please.
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 15th Mar 2011 02:28
Do you want coke with that So it's definitely no spaces, which is just as well because the current AppGameKit compiler has zero spaces and works nicely too! As to ID removal, AppGameKit will allow you both approaches:

LoadImage ( 1, "hello.png" )
CreateSprite ( 1, 1 )
SetSpritePosition ( 1, 50, 50 )

Or:

yourimage = LoadImage ( "hello.png" )
CreateSprite ( 1, yourimage )
SetSpritePosition ( 1, 50, 50 )

Or even:

yourimage = LoadImage ( "hello.png" )
yoursprite = CreateSprite ( yourimage )
SetSpritePosition ( yoursprite, 50, 50 )

Also, it's also another good example why I prefer not to pre-declare my variables. I cut and paste my variables a lot to avoid typos and I can knock out this code two lines quicker than:

yourimage As Integer
yoursprite As Integer
yourimage = LoadImage ( "hello.png" )
yoursprite = CreateSprite ( yourimage )
SetSpritePosition ( yoursprite, 50, 50 )

As a side note, we're adding a compiler flag to force pre-declaration of variables, switch-able in the IDE so everyone gets what they want

I drink tea, and in my spare time I write software.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 15th Mar 2011 15:16
Lee:
Wouldn't it be fantastic if AppGameKit suported this method of declaring variables, it saves a lot of time and space:

integer yourimage, yoursprite

I would also like to use "int" instead of the whole word "integer" everywhere. There's also "str" and "flt". Again to save on time and space.

LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 18th Mar 2011 05:45
You mean like C++?

I drink tea, and in my spare time I write software.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 18th Mar 2011 10:20
Lee:
Nope, like in Lingo

I don't have much C++ experience but yeah, they also have that. Before DB I coded in Director 6 which used the scripting language Lingo. I used to declare global variables like that (global var1, var2, var3...).

Which would you prefer:

or


Here's another one for you:

or


IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Mar 2011 15:38
Things to think about:



Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 18th Mar 2011 18:02
I think I would prefer this, all would be floats:


LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 7th Apr 2011 05:25
I certainly see why you would want to start shortening your declarations as they can get pretty vast! Maybe in the future we can add some abbreviations. My goal today is to protect the readability of AppGameKit and so although it's longer, it does clearly describe what is what:

A AS INTEGER : B AS FLOAT : C AS STRING

Right away you can 'read' what each variable type is, without understanding the magical symbols of FLT, INT, CHAR*, LPVOID, _INT64* and so on...

There are some space savers though if you're sticking with integer values such as:

TYPE leetype
a b c
ENDTYPE
lee AS leetype

This would define a type called leetype, and allow assignments such as lee.a=1 : lee.b=2 and lee.c=3. Admittedly not as easy to read, but a tidy way to create structures quickly (even quicker and shorter than C++), which would be:

struct leetype
{
int a;
int b;
int c;
}
leetype lee;

I think readability should win over possible abbreviations, and I am also guarding against adding two ways to do one thing as the result will be a wide range of AppGameKit code out there, only half of which everyone will be able to follow. Also the AS INTEGER style of declaration comes directly from DBP and has proved quite popular.

I drink tea, and in my spare time I write software.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 7th Apr 2011 11:18
Lee:
DBP already supports:
GLOBAL var1, var2, var3

So why not at least add support for:
INTEGER int1, int2, int3
STRING str1, str2, str3
FLOAT flt1, flt2, flt3

Makes sense to me, and no abbreviations required.

And this would be nice as well:
GLOBAL INTEGER int1, int2, int3
GLOBAL STRING str1, str2, str3
GLOBAL FLOAT flt1, flt2, flt3

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 12th May 2011 15:48
I just want it like DBPro.


Cheers.

God help me, Please.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 16th May 2011 23:59
No spaces for me thanks. We could have something like this
Load.Image(1,"llama_likes_yoghurt.png")
Or however the syntax works. Or just no spaces if you want to be boring.

Your memory has been erased by a mod - Your new name is Brian.

Login to post a reply

Server time is: 2024-11-23 11:54:06
Your offset time is: 2024-11-23 11:54:06