Quote from: TheExDeus on May 07, 2014, 06:25:23 PM
It's not odd at all. A for loop repeats the code inside it until a condition is met (http://en.wikipedia.org/wiki/For_loop). In this case that means drawing 100 times (numbers from 0 to 99) in one step.
But the reason for the loop in my example was
to repeat code until the condition of i=100 is met.
I have seen maybe print counter examples done with for/loop this way, that's why I am confused.
Quote
I think you don't really understand how cycles work. Or how steps work. The code you put in events like draw or step are executed once every frame (called step in GM).
I knew that and understand how it works and am aware 1 frame = 1 step, and the draw/step is executed at room speed, by default 30 steps per second.

And I know what create events are, I use those to initialize variables and set my object's settings upon create.
Quote
codes you posted work just fine. They would work like that in GM, ENIGMA, C++, Basic, Python or anywhere else.
You are wrong about BASIC Harri

You have no idea how much I used loops when I used BASICS,
it was abused lol and I already gave you an example of a BASIC loop. But in BASIC there are no draw events, create events, step, begin and end step events

shit works differently now apparently
and I am seriously fucked, unless I know how things are to be done now.
QuoteIt works just like you coded it. There are no bugs or problems with while, for or repeat cycles.
If it worked I would not be posting this. I am working based on the logic of what I need done.
perhaps a better way for me is to simply say what I need done and then someone recommends me code on how to do it

I am pretty sure some of the stuff is broken in ENIGMA, because I don't always get the same outcome when running / compiling games ...

here is an example, let's say I want to read from
a file, start pos to end pos, i BASIC I used for loop for that and used the loop's for variable in the code between the for and next. I saw some C++ programs do this, so why can't I do it here?
Quote
No it shouldn't. As I mentioned before Draw event (the one actually drawing to the screen) is executed once per frame. While the for(){} you have created here executes 100 times per frame. So when using that loop you should see the object at x=100 in every frame.
Understood. So, in this example, how can I make an object move 100 pixels (1 pixel at a time) using a for / loop then ?
I thought that in each step the i would increment 1. I could have sworn seeing for loops in step events before, how can that be then ?
Quote
Read up on loops. You said you used Basic before, I think they had loops too.
On an expert level yes I used BASIC and I can swear on my life that it worked differently.
Quote
execute it every step from the beginning. You cannot have one script execute spanning multiple steps. Like this is impossible:
So what is the alternative then, incrementing the value of i myself, but then I would have to use do until or while, and that does not work either...
When reading docs in enigma and GMS I see for loops being used, when I apply the examples they don't work.