I think someone already mentioned this, but maybe making an
easily comprehendable modification to focus on While loops.
While(condition,[paramters])[.Add_Thread] {
}
Example: (Creates 10 independant Threads with Draw/Refresh filler code)
var %N 0
While (%N < 10,Thread_Name).Thread_Add {
inc %N
}
alias Thread_Name {
; Control synchronizations or events from here?
; Also maybe good idea to define the loop code here as well.
;
; /Var (private var)
var -p %tmps $2-
; /Set (Global var) where $1 is defined as a unique numeric thread #.
; -g is for global variable, -L to lock the variable from other
thread change, other threads will have to wait, but other
execution is aloud for that thread if other instructions are defined.
inc -gL %Plot
inc -gL %Refresh
;%Plot resets to 1 when all 10 threads have been cycled through.
if (%Plot > 10) { set %Plot 1 }
;Plots Coordinates
drawdot -n @Plot 1 5 $mouse.x $mouse.y
;Refresh Drawings
drawdot @Plot
}
Its not very useful at this stage, but I think it served as a
good possible example of what it could be like. I know it still has alot of potential if done just right. the filler code is not
written in stone, so accept as such.
Last edited by NrWarren; 18/05/07 01:26 AM.