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 / AGK V2 Compiler Test

Author
Message
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 23rd Jun 2014 22:45 Edited at: 23rd Jun 2014 22:46
Quote: "I get the following error: "Function call must end with a close bracket in main.agc at line 785""


I get the same error with this code, this should work right?



JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 23rd Jun 2014 23:41
That does look like an error!

Back to empty endif:

It's up to TGC to define the language. There is no formal specification that I've seen.

1) Is endif syntactically identical to end if ?
2) A conditional implies a following statement, which could either be singleton or a block:

If x>3
y = 5 // this create a non-empty block
endif

or

If x>3 then y = 5 endif // no block required

But

If x>3
// empty block
endif // error - no block to end

It's quite interesting to compare languages on this. Both C and Pascal require explicit blocks - "begin end" in Pascal "{ }" in C.

The following examples are Object Pascal:

If x>3 end; // compiles - compiler throws away as rubbish

If x>3 then end; // Error - this is an empty statement where a statement is required

If x>3 then begin end; // perfect for a stub

AGK Basic is non-standard. So are most Basic implementations. The essential thing about a programming language is it must not be ambiguous, which, unfortunately, because of its history, Basic is.

So can we have an actual Report describing the syntax?

-- Jim - When is there going to be a release?
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 23rd Jun 2014 23:51 Edited at: 23rd Jun 2014 23:55
I see these as the same thing and neither should give an error. And I can't see why they should.

if x = y
endif

if(x==y) {
}

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 23rd Jun 2014 23:56
They are totally different. The second is a block, the first isn't.

-- Jim - When is there going to be a release?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 00:12 Edited at: 24th Jun 2014 00:14
i agree with Digital Awakening, there is no different.
{ = Then } = EndIf
but then is optional in basic normal.
is something behind then in same row linebreak is endif
whatever ....

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 24th Jun 2014 00:17
To me, both of them are empty blocks. Since both have a beginning and an end.

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 24th Jun 2014 02:42 Edited at: 24th Jun 2014 02:44
@Digital Awakening
Quote: "I get the same error with this code, this should work right?"


Shouldn't the last line be 'loop' not 'endif'?

Edit-scratch that, didn't read back far enough
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Jun 2014 05:27
I've added a new update to the downloads section, check the first post for details.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 24th Jun 2014 09:32
Quote: "Shouldn't the last line be 'loop' not 'endif'?"

How did that get in there?

Quote: "I've added a new update to the downloads section, check the first post for details. "

Sweet

Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 24th Jun 2014 09:38
This works with the latest update:



Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 09:47
@Paul,
jump did not work or must i change something?
said unexpected token 1 (V2A3 with compiler update 2).


AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 12:04 Edited at: 24th Jun 2014 12:05
@Paul,
now it makes a interpreterv2.exe in project folder but starts my old
try.exe
means the compiler did not use my project name in exe.
(V2A3 with compiler update 2).

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 24th Jun 2014 12:44
Markus
You must always use the compile and run button until the official alpha release.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 12:46 Edited at: 24th Jun 2014 12:52
@DA
ahh, i used compile and than run ... because not want compile run and broadcast...
thanks for hint.
edit: hmm, did not start at pc. i think its waiting for broadcast first!?

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 24th Jun 2014 14:23 Edited at: 24th Jun 2014 14:25
Hi

Thank you Paul for the new compiler.
I have tried it with some of my current project (approx : 3500 lines).

I have a strange "error" :
in my "start screen" (title screen with 2 butons) all is fine, but when I go in the other screens (credits, profil, game...) there is no more sprite.
(I use DeleteAllSprites())

Here is a code to test (it works fine in AGKV1) :



http://www.dracaena-studio.com
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Jun 2014 17:55
Quote: "in my "start screen" (title screen with 2 butons) all is fine, but when I go in the other screens (credits, profil, game...) there is no more sprite."


Thanks, fixed or the next version.

Quote: "jump did not work or must i change something?"


Currently the compiler does not support numbers as labels, I'll have to look to see if it difficult to support this.

Quote: "hmm, did not start at pc. i think its waiting for broadcast first!?"


This version does not do any broadcasting, it should create interpreterV2.exe in the project directory and then run it.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 18:53 Edited at: 24th Jun 2014 18:58
@Paul,
ok, i use name at label.
now i got this message each time i run a project (at windows 8.1).
i think it was the reason that i can not start or see my exe i tryed at work today in my "pause time" with windows 7.
(i want use v2 alpha/beta for developing new app, i need broadcast too.)



AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 19:05 Edited at: 24th Jun 2014 19:09
@Paul,
test 2, now my global variable is 0 at other location in other agc file.
arrrgg, the reason was u create a interpreterV2 folder for my project
in user/documents what not contains my saved data.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 24th Jun 2014 19:11
If Google translate is correct that says that Windows SmartScreen prevented the app from running because Windows didn't recognise it? It looks like one of the buttons says "Run Anyway", does this work?

Unfortunately because the interpreter is a downloaded exe it looks like Windows is going to stop you running it unless you are sure it is safe. You could turn off SmartScreen to avoid the errors for now, I don't know if this would happen with an installed version of the exe.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 19:15 Edited at: 24th Jun 2014 19:25
@Paul Johnston
ahh understand,because web and installed my copy, its a option at exe, i know.
(the windows dialog (green screenshot before) hide the continue button until u click ok.)
when we can get the normal docu folder and exe name and broadcast as before?

its this:


AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Jun 2014 19:33 Edited at: 24th Jun 2014 19:33
@Paul,
with compiler test 2 my particels are at wrong place.


AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265

Attachments

Login to view attachments
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 24th Jun 2014 23:26
Got Tired of renaming the files to switch between compilers so created a batch file to do the job.

Setup (assuming currently using V1 compiler);
- Rename the new Compiler exe to "V2_AGKCompiler.exe"
- Rename the new Interpreter exe to "V2_Windows.exe"
these go in the same folders as before ("compiler" and "compiler/interpeters" )
Put the batch file in the compiler folder and create a shortcut on your desktop.
Run it once, it renames;
AGKCompiler.exe to V1_AGKCompiler.exe
Windows.exe to V1_Windows.exe
V2_AGKCompiler.exe to AGKCompiler.exe
V2_Windows.exe to Windows.exe

Run it again, it renames them back.

Each time,it displays a popup telling which one it did.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Jun 2014 02:16
Quote: "with compiler test 2 my particels are at wrong place."


I will need some example code to replicate the problem.

Quote: " the reason was u create a interpreterV2 folder for my project
in user/documents what not contains my saved data."


I forgot about this, the next version will have the exe and documents folder named after the project folder as before.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Jun 2014 09:31 Edited at: 25th Jun 2014 09:37
@Paul
1.
ok, here the functions i use for the particles.
the problem began with compiler update.
2.
ok fine,no problem, but i need broadcast too,
the problem i had is i can install only one agk player at
my handy. i used a community made player for v2a3.
it would be great if u make extra player in google store for v2
that i/we can test/use old and new agk version.



AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Alien Menace
AGK Developer
19
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Earth (just visiting)
Posted: 28th Jun 2014 05:55 Edited at: 28th Jun 2014 06:00
Quote: "Quote: "GLOBAL PLAYERX#=WIDTH#/2"

This is no longer supported as default values are now assigned at compile time, so you can declare global variables any where in your program (including includes) and have their value set when the program starts. To set the value at runtime use
+ Code Snippet at the appropriate time."


I really don't understand this. If WIDTH# has already been declared and has been assigned a value previous to using it in the assignment expression for PLAYER# then why would this not work?

Is there any documentation for dynamic lists yet?

Apps published: 4
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 28th Jun 2014 10:07
Paul, I have a few questions;

1) Passing by reference.

While you've shown passing a whole array by ref, Is it possible to pass parts of an array of types by reference?

For example;

Would this work?

2) array.find(expr) to return the array index that equals the expr in a sorted array

Does it work in an unsorted array? I figure it would probably be faster than a manual look up.

I suppose this would depend on whether a "sorted array" is just an array that has been sorted, or a special type of array with additional internal stuff for indexing.

3) Also in relation to array.find(expr), what does this return if no exact match is found? a fail indicator such as zero or the closest match?

Finally,

4) array.reverse() to reverse all the elements in an array

Is this reverse the current order or reverse the sorted order (ie sort in descending order)?

Plus, I don't really get this command, since an array can be parsed in either direction, what benefit is there in physically reversing the order?

Thanks in advance.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 28th Jun 2014 16:18
Quote: "ok, here the functions i use for the particles."


The particles are positioned as the code specifies, SetParticlesStartZone ( 1, -10, 0, 10, 0 ) puts them in the top left corner. Can't see a bug here.

Quote: "I really don't understand this. If WIDTH# has already been declared and has been assigned a value previous to using it in the assignment expression for PLAYER# then why would this not work? "


Because the default value for PLAYER# is stored in the bytecode file so that it can be initialised as soon as the program starts. Since there is no guarantee about which order the variables will be stored in the bytecode file PLAYER# might be initialised before WIDTH#.

Quote: "Is there any documentation for dynamic lists yet?"


Not yet.

Quote: "While you've shown passing a whole array by ref, Is it possible to pass parts of an array of types by reference?"


Yes, that should work.

Quote: "Does it work in an unsorted array?"


No, .find() assumes the array is sorted as there is no way for the interpreter to distinguish between sorted and unsorted arrays (without actually traversing the array).

Quote: " in relation to array.find(expr), what does this return if no exact match is found?"


It will return -1 if no match is found

Quote: "Is this reverse the current order or reverse the sorted order (ie sort in descending order)?"


It just reverses the elements as they are. Admittedly it's not much use as you say, but it was easy to add so I figured why not.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Jun 2014 02:16
particle startzone is relative from particle position.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Jun 2014 03:27
Your example didn't compile so I cut out everything except the particle setup code which doesn't set a position. I notice you use the line "setparticlesposition(1,x#,y#)" later on, if I add that back in and set a manual position the particles move as expected.
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 29th Jun 2014 10:04
Hi Paul

Could you tried this code, please ?

It works, but when I close the window, the application crash :



http://www.dracaena-studio.com
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 29th Jun 2014 15:15
@Paul,
ok, i try make a working example.
but its real different, i start 108 its ok and in v2 its wrong.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Jun 2014 15:51
Quote: "Could you tried this code, please ?
It works, but when I close the window, the application crash :"


It doesn't crash as such, but it does stop responding because Sync() isn't being called.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jun 2014 01:36 Edited at: 30th Jun 2014 01:38
@Paul,
i made some Tests, it is the udt return struct, inside the function
it is ok, outside i have one value =0 other value is filled!?


AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Jun 2014 15:35


Works here, what is the definition of your TRocket type?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Jun 2014 15:45
@Paul
unfortunately ,it works in minimized code,
but not in my project.
can i mail you my project as zip?
i had made debug prints at screen.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Jun 2014 16:21 Edited at: 30th Jun 2014 21:02
Yes, my email address is at the bottom of my posts.

Edit: I received the code and managed to replicate the bug, it will be fixed in the next version
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 1st Jul 2014 15:15
Hi

I have an issue with SetVirtualResolution(), the resolution isn't like it should be.
I have tried my code with an old version of AGk (the trial) and it works fine, but with the new version (108.21) and with v2, the resolution is wrong.




Is it normal ?

http://www.dracaena-studio.com
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 1st Jul 2014 18:45
On Windows and Mac GetDeviceWidth() and GetDeviceHeight() will return the current window size, which in windowed mode can never match the maximum possible resolution because of the window border. If you use fullscreen mode you could get the window to be the maximum resolution.

To find out what the maximum possible resolution is on the current device you can use GetMaxDeviceWidth() and GetMaxDeviceHeight()
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 1st Jul 2014 22:44 Edited at: 2nd Jul 2014 09:12
@Paul : ok, I understand, but why in the trial Version, I have the good resolution (1680*1030 approx) and with agk 108.21 and with compiler v2 I have only : 1552*970 ?
It should be the same resolution like the trial version, no ?

I have tried GetMAxDeviceWidth() and GetMaxDeviceHeight()and I have : 1680*1050. But in fact, I have only 1552*970 as width and height for the window.

I can send you the project file, if you want to test .

http://www.dracaena-studio.com
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 3rd Jul 2014 15:34
Quote: "but why in the trial Version, I have the good resolution (1680*1030 approx) and with agk 108.21 and with compiler v2 I have only : 1552*970 ?"


The trial version hasn't been updated in a while so is still version 107, there must have been a change since then that caused this.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 7th Jul 2014 00:06 Edited at: 7th Jul 2014 00:17
Looks like code folding using '{ and '} no longer works I suppose it wasn't an intended feature, but I'll miss it.

Edit: Also, out of curiosity, what algorithm does the built in array sorting use?

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Jul 2014 04:11
Integer and Float sorting use radix sort, Strings use quick sort.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 7th Jul 2014 06:18
Interesting. I never thought of using radix sort on floats. I suppose it still makes just as much sense

Also that reminded me of this video,


AncientGamer
14
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 7th Jul 2014 12:34
Installed AppGameKit V2 Alpha 3, seemed to go well. Replaced files with those in compiler update 2 and now I get this: "It seems that this project has not been built yet. Do you want to build it now?". I have to compile every time I run a program from the IDE and only if I click run and compile after I get the previously quoted prompt. Clicking compile first and then clicking run still produces the prompt.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 7th Jul 2014 18:40
Quote: "Installed AppGameKit V2 Alpha 3, seemed to go well. Replaced files with those in compiler update 2 and now I get this: "It seems that this project has not been built yet. Do you want to build it now?". I have to compile every time I run a program from the IDE and only if I click run and compile after I get the previously quoted prompt. Clicking compile first and then clicking run still produces the prompt."

I had that problem in the first edition of AppGameKit when the names in my cbp file didn't match the .exe .byc and so on (I think the folder name too if I remember correctly). Did you move your project perhaps?

AncientGamer
14
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 7th Jul 2014 18:59
No projects moved. This also occurs when I try to compile and run the default 'Hello World' program and happens regardless of where I save my projects to.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 7th Jul 2014 19:18 Edited at: 7th Jul 2014 19:52
Quote: "No projects moved. This also occurs when I try to compile and run the default 'Hello World' program and happens regardless of where I save my projects to."

Hmm strange.

Also, this line of code

gives me the error
Quote: "Unexpected token "=" at ..."

but if I change the variable name it does not. So continue has become a keyword? Does it function like java? (it doesn't seem to be doing anything that I can tell)
Edit: Hold on maybe it does work Either AppGameKit v2 runs slower, it doesn't actually work, or I'm crazy

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 7th Jul 2014 20:15
"continue" is a keyword.

-- Jim - When is there going to be a release?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Jul 2014 10:22
Oooh, I can't believe I didn't know that... I'll have to go through some of the core language again when I get the chance. I've been using "exit" as I didn't know "continue" was available. Tomarto/Tomayto but I'd rather be consistent between languages wherever possible.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 8th Jul 2014 17:32
Quote: "Oooh, I can't believe I didn't know that... I'll have to go through some of the core language again when I get the chance. I've been using "exit" as I didn't know "continue" was available. Tomarto/Tomayto but I'd rather be consistent between languages wherever possible."

It seems to be new

Login to post a reply

Server time is: 2024-04-24 09:43:47
Your offset time is: 2024-04-24 09:43:47