You are Genius! Thank you very much. I just found and bought the GLBasic today. Thanks to you my program runs correctly.It is a simulation of the lottery drawing to help the user generate a unique set of numbers.It simulates an actual drawing by mixing virtual lottery balls rather than generating random numbers.Not like that is going to help me win the lottery but the concept provided some enthusiasm on my part to fight the syntax.

hehe nice idea! I did a random number generator a couple years ago on the purpose that my my machine+GLB would make it an easy win...well, I didn´t win, probably cause my machine was angry.

You will see GLB is a fine tool, check the online manual or press F1 in program and you pretty much get all you need to start up good.This forum is also gold stuffed with examples and solutions beyond belief. Some questions can be answered with a simple search.

About your program don't care I did the same when I bought GLbasic but I continue poor, I don't win the Lottey

About your code the error it's like says Erico you forget put the Endif, my counsil it's aleways read what says the compiler, the bottom part of your screen, I never read when I start to do code and it's a great error, you will learn a lot spend a bit of time reading what happends in your code...

...It simulates an actual drawing by mixing virtual lottery balls rather than generating random numbers.Not like that is going to help me win the lottery but the concept provided some enthusiasm on my part to fight the syntax....

I´m pretty sure you will manage to resolve it.

Then, you could also take it a bit further and add visuals and sound.That code could be a great playground to test and check out multimedia commands in GLB, specially if you already have the code (logic part) working perfectly beneath it.

Let us know the results! Say, I´m even willing to try out your soft´s numbers on the lottery here.

SORTARRAY is indeed good, unless you need to swap more than one array at a time. In this case it would be OK, but for a high score table it's not so good (where you are changing scores, names and possibly level attained etc.)