Hi Everybody,
I am new to Lazarus programming, but am familiar with BASIC. Using one of my programmes written in BASIC to help learn Lazarus and need some help please. The programme I am working on is a Lottery programme that prints ALL combinations as per the code below:
var
a,b,c,d,e,f,n,count: integer;
begin
n:= 7;
count:= 0;
FOR a:= 1 TO n - 5 DO
FOR b:= a + 1 TO n - 4 DO
FOR c:= b + 1 TO n - 3 DO
FOR d:= c + 1 TO n - 2 DO
FOR e:= d + 1 TO n - 1 DO
FOR f:= e + 1 TO n DO
begin
count:= count+1;
//writeln(a,',',b,',',c,',',d,',',e,',',f);
end; {ends for loop}
writeln(count,' Lines Generated');
writeln;
writeln;
writeln('Press <Enter> To Quit');
readln();
end.
This works fine in the console window, but I need some help outputing the results to textbox or memo (or Listbox?) in a GUI. After trying on my own for a few days and doing a search in the forum for ideas I am only able to print the variable name (e.g. it will only print "a" or "f" but it doesn't print the six numbers in sequence. I'm sure it's a simple solution but I am stumped and any help would be much appreciated.
Thanks