Raised This Month: $ Target: $400
 0% 

[PAWN][Sourcemod 1.8.0] goto


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-07-2016 , 18:00   [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #1

Does sourcemod 1.8.0 support goto? It won't compile for me, not even the goto_test in the testsuite.
PartialCloning is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-07-2016 , 18:21   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #2

Tell me, why do you need goto?

My opinion:
That would only make it so aweful and unreadable...
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-07-2016 , 18:30   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #3

To jump to a part of the code straight away under certain conditions.

It makes the code more readable the way I see it.
PartialCloning is offline
psychonic

BAFFLED
Join Date: May 2008
Old 04-07-2016 , 18:56   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #4

Quote:
Originally Posted by PartialCloning View Post
not even the goto_test in the testsuite.
The test is there to ensure that it doesn't work.
psychonic is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-07-2016 , 18:59   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #5

Quote:
Originally Posted by psychonic View Post
The test is there to ensure that it doesn't work.
+1
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 04-08-2016 , 16:36   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #6

Save your gotos for assembly coding.
__________________
Chdata is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-08-2016 , 16:43   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #7

Gotos are useful for multi-level breaks from loops.
__________________
Merudo is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 04-08-2016 , 17:12   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #8

Quote:
Originally Posted by Merudo View Post
Gotos are useful for multi-level breaks from loops.
Only with poorly designed code.
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-08-2016 , 17:25   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #9

Code:
for ...
  for ...
    if(breakout_condition) 
      goto final;

final:
How is this bad?
__________________
Merudo is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 04-09-2016 , 04:06   Re: [PAWN][Sourcemod 1.8.0] goto
Reply With Quote #10

Why not just use break;...?
__________________

Last edited by Chdata; 04-09-2016 at 04:06.
Chdata is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode