T
Torbjørn Morka
I am currently working with a small program using BCB 6, and this is
my question.
When clicking the button
the code is this...:
//--------------------------------------------------------------------
-------
void __fastcall TForm1::Button1Click(TObject *Sender)
etc...
everything here below was fine.
//--------------------------------------------------------------------
-------
far above this i use the Randomize-call, with success, right after the
declaration
of the Form itself.
Now, in my little program there are 4 smaller procedures or functions.
Beeing intil now used to Delphi, i found out that it was not quite the
same...
procedure 1 is the code written for Button1, and that piece was
ok.(creating a random number)
procedure 2 is to check for equals in an array,
procedure 3 is to check for numbers greater than the
following(bubblesorting)
procedure 4 is to swap numbers.
HOW do i declare a procedure/function, and WHERE do i put the code ??
I obvious can not say
for (a = 0; a < 8; a++ ) { //
number[a] = (random(99) + 1) ;
}
// now i want to call this one
bubblesort; //supposed to be calling the function/procedure...
or
bubblesort();
huh ??
I want to fill in the blanks for my self, but the correct declaration
is apreciated...
Torbjorn.
my question.
When clicking the button
the code is this...:
//--------------------------------------------------------------------
-------
void __fastcall TForm1::Button1Click(TObject *Sender)
etc...
everything here below was fine.
//--------------------------------------------------------------------
-------
far above this i use the Randomize-call, with success, right after the
declaration
of the Form itself.
Now, in my little program there are 4 smaller procedures or functions.
Beeing intil now used to Delphi, i found out that it was not quite the
same...
procedure 1 is the code written for Button1, and that piece was
ok.(creating a random number)
procedure 2 is to check for equals in an array,
procedure 3 is to check for numbers greater than the
following(bubblesorting)
procedure 4 is to swap numbers.
HOW do i declare a procedure/function, and WHERE do i put the code ??
I obvious can not say
for (a = 0; a < 8; a++ ) { //
number[a] = (random(99) + 1) ;
}
// now i want to call this one
bubblesort; //supposed to be calling the function/procedure...
or
bubblesort();
huh ??
I want to fill in the blanks for my self, but the correct declaration
is apreciated...
Torbjorn.