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] Unexpected token "loop"

Author
Message
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 3rd Feb 2024 01:10
How in the heck is this wrong? There should not be an error to my knowledge.
I call the function from the main file and some how it started showing this error. There is nothing but a do/loop, nothing complicated



ASRock motherboard/ AMD 4.1 Ghtz Duel core/16GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.

Attachments

Login to view attachments

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

Go to answer

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 3rd Feb 2024 01:21
This post has been marked by the post author as the answer.
I found the problem. 2 if/endif statements and only one endif is there. I put the other endif in and it works. Although for some reason I can't get the detection code in the main loop to work. The screen before this screen works and it has 3 areas detecting a click and all 3 work. Why won't this one work? It has same dectection code as the previous screen, just different area.
ASRock motherboard/ AMD 4.1 Ghtz Duel core/16GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
Zaxxan
AGK Developer
3
Years of Service
User Offline
Joined: 17th Nov 2020
Location: England
Posted: 3rd Feb 2024 02:43 Edited at: 3rd Feb 2024 02:46
You have two Mouse Y's with less than shouldn't one of these be greater than?

If MouseX > 439 and MouseX < 491 and MouseY < 304 and MouseY < 256
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 3rd Feb 2024 05:09 Edited at: 3rd Feb 2024 05:10
Yes, thank you for noticing that. I changed it and it still doesn't work. I can click all day in the box and nothing happens.

Below is the function that is a screen before the above one. This one works.

ASRock motherboard/ AMD 4.1 Ghtz Duel core/16GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 3rd Feb 2024 15:36
Looks like you're checking if the MouseY is less than 256 when it should be 356.

I would highly recommend turning your button code into a reusable function to avoid this kind of mistake. You could probably make it an immediate mode sort of function, like this:


Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 3rd Feb 2024 23:03 Edited at: 3rd Feb 2024 23:49
Quote: "hendron said:

Looks like you're checking if the MouseY is less than 256 when it should be 356.

I would highly recommend turning your button code into a reusable function to avoid this kind of mistake. You could probably make it an immediate mode sort of function, like this:"


I corrected the MouseY coordinate code and it still doesn't work. I will try to set variables for the unfilled boxes coordinates that create the clickable button areas and see if I am smart enough to make a reusable function for multiple screens with different amounts of text objects and clickable areas

[Edit] - I just figured out that for some reason it doesn't work if you click inside box with "1" inside, but if I move the mouse up and to the left diagnally some and click it detects the click and moves on to the next screen. Why would it do that if my MouseX and MouseY coordinates are correct? (which they are correct) I verified it more than once to make sure the box coordinates were correct.

First screen code:


Second screen code that isn't working:
ASRock motherboard/ AMD 4.1 Ghtz Duel core/16GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 3rd Feb 2024 23:38 Edited at: 3rd Feb 2024 23:40
Quote: "I corrected the MouseY coordinate code and it still doesn't work"


So you changed this line:
If MouseX > 439 and MouseX < 491 and MouseY < 304 and MouseY < 256

to this:
If MouseX > 439 and MouseX < 491 and MouseY > 304 and MouseY < 356

and it still didn't work? Sorry, just making sure I'm on the same page here.
Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 3rd Feb 2024 23:54
Quote: "hendron said:

So you changed this line:
If MouseX > 439 and MouseX < 491 and MouseY < 304 and MouseY < 256

to this:
If MouseX > 439 and MouseX < 491 and MouseY > 304 and MouseY < 356

and it still didn't work? Sorry, just making sure I'm on the same page here."


That is correct, yes

I edited my previous post, the code isn't working correctly, but the code is correct and it will advance to the next screen if I click up and to the left about an inch or two. The code is correct, but why would it be doing that?
ASRock motherboard/ AMD 4.1 Ghtz Duel core/16GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 4th Feb 2024 00:02
Ah ok, from your edited post/code:



You've got all less than ( < ) comparisons here. Try changing that line to this:

Unseen Ghost
21
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 4th Feb 2024 02:39 Edited at: 4th Feb 2024 02:40
How I kept not getting the right sign I don't know, because I could have sworn that I put the right signs in for MouseY.

I changed it to what you have in your bottom snippet.

Thank you for staying with me on that hendron. It works now
ASRock motherboard/ AMD 4.1 Ghtz Duel core/16GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio

No one cares how much you know until they know how much you care.

Login to post a reply

Server time is: 2024-04-27 22:03:14
Your offset time is: 2024-04-27 22:03:14