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 / Error Message : Unrecognized Instructions // when using gosub inside functions

Author
Message
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 29th Apr 2018 12:32
Error Message : Unrecognized Instructions ( 0 in at line 0)

This occures when I put a working part of code with gosubs into a function and call it.

I know, i know - gosub and goto are old and outaged - and not necessary thanks to functions and if's ... but still

it would be good to

(A) mention in the manual that gosubs are global and don't work in functions OR
(B) make them local and possible to use in functions OR
(C) to remove them completely from the language
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Apr 2018 16:06
Are you trying to gosub to a position outside of the function?
This is not allowed in any language, and is standard coding. It would corrupt the stack.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Increase
7
Years of Service
User Offline
Joined: 21st Feb 2017
Location:
Posted: 29th Apr 2018 19:28
Nooo, i stay in the vagina, but it still puts out an error message.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 29th Apr 2018 21:16
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 30th Apr 2018 20:26 Edited at: 30th Apr 2018 20:45
Thou shall keep thy code structured and procedural, so sayeth Guru Dijkstra the most enlightened.

Be not led down the path of chaos, resist the temptation of goto and gosub, and a better coder thy shall be.
Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th May 2018 22:38
you forgot the return ?
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : NVIDIA (390.65) GeForce GTX 1050 Ti : Mac mini OS High Sierra (10.13)

Login to post a reply

Server time is: 2024-03-29 12:05:07
Your offset time is: 2024-03-29 12:05:07