{"action":"created","issue":{"url":"https://api.github.com/repos/Misiur/YSI-Includes/issues/83","repository_url":"https://api.github.com/repos/Misiur/YSI-Includes","labels_url":"https://api.github.com/repos/Misiur/YSI-Includes/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/Misiur/YSI-Includes/issues/83/comments","events_url":"https://api.github.com/repos/Misiur/YSI-Includes/issues/83/events","html_url":"https://github.com/Misiur/YSI-Includes/issues/83","id":144640531,"number":83,"title":"y_iterate: foreach( new x: itername< > ) + a possible bug ?","user":{"login":"IstuntmanI","id":6208948,"avatar_url":"https://avatars.githubusercontent.com/u/6208948?v=3","gravatar_id":"","url":"https://api.github.com/users/IstuntmanI","html_url":"https://github.com/IstuntmanI","followers_url":"https://api.github.com/users/IstuntmanI/followers","following_url":"https://api.github.com/users/IstuntmanI/following{/other_user}","gists_url":"https://api.github.com/users/IstuntmanI/gists{/gist_id}","starred_url":"https://api.github.com/users/IstuntmanI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IstuntmanI/subscriptions","organizations_url":"https://api.github.com/users/IstuntmanI/orgs","repos_url":"https://api.github.com/users/IstuntmanI/repos","events_url":"https://api.github.com/users/IstuntmanI/events{/privacy}","received_events_url":"https://api.github.com/users/IstuntmanI/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-30T16:10:00Z","updated_at":"2016-03-30T16:35:14Z","closed_at":null,"body":"In the past two days I've got in some situations in which I would need something like in the title, for a better performance.\r\n\r\nLet's say we have this code:\r\n```pawn\r\nnew Iterator:VehiclePlayers< MAX_VEHICLES, MAX_PLAYERS >;\r\n\r\nIter_Add( VehiclePlayers< 30 >, 5 );\r\nIter_Add( VehiclePlayers< 50 >, 10 );\r\n```\r\n\r\nand somewhere we would need to loop through all players which are in a vehicle:\r\n```pawn\r\nforeach( new x: VehiclePlayers< > )\r\n{ }\r\n```\r\nbut it gives these errors:\r\n>error 029: invalid expression, assumed zero\r\n>error 001: expected token: \")\", but found \";\"\r\n\r\nIt could be really useful. I don't know if it can be actually made.\r\n\r\n------------------\r\n\r\nBy the way, there's a little bug: using\r\n```pawn\r\nnew Iterator:itername< 50, 50 >; // just a random size\r\nIter_Add( itername< 30 >, 40 );\r\nforeach( new x: itername )\r\n{\r\n    printf( \"Currently in loop: %d\", x );\r\n}\r\n```\r\n\r\ndoesn't actually give any compile warning/error and it neither loops through anything. But it works if you add in < 0 >, but loops only through the values which are in < 0 >, not in any other. I guess \"new x: itername\" is a \"synonym\" for \"new x: itername< 0 >\", which isn't alright ."},"comment":{"url":"https://api.github.com/repos/Misiur/YSI-Includes/issues/comments/203515695","html_url":"https://github.com/Misiur/YSI-Includes/issues/83#issuecomment-203515695","issue_url":"https://api.github.com/repos/Misiur/YSI-Includes/issues/83","id":203515695,"user":{"login":"IstuntmanI","id":6208948,"avatar_url":"https://avatars.githubusercontent.com/u/6208948?v=3","gravatar_id":"","url":"https://api.github.com/users/IstuntmanI","html_url":"https://github.com/IstuntmanI","followers_url":"https://api.github.com/users/IstuntmanI/followers","following_url":"https://api.github.com/users/IstuntmanI/following{/other_user}","gists_url":"https://api.github.com/users/IstuntmanI/gists{/gist_id}","starred_url":"https://api.github.com/users/IstuntmanI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IstuntmanI/subscriptions","organizations_url":"https://api.github.com/users/IstuntmanI/orgs","repos_url":"https://api.github.com/users/IstuntmanI/repos","events_url":"https://api.github.com/users/IstuntmanI/events{/privacy}","received_events_url":"https://api.github.com/users/IstuntmanI/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T16:35:13Z","updated_at":"2016-03-30T16:35:13Z","body":"@Dayvison I know. That's why I made this suggestion, so we could directly loop through ALL values added, not only through all values from the specified ID. With VehiclePlayers< X > you loop through all players which are in that vehicle, but with VehiclePlayers< > you should be able to loop through all players in a vehicle.\r\n\r\n@Crayder Well, that usage should have a different behaviour, for sure new y_iterate users could try something like that and they wouldn't understand why it isn't working."}}