473,320 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C++ builder question..

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.
Jul 23 '05 #1
7 2108
"Torbjorn Morka" <la****@ticali.no> wrote...
I am currently working with a small program using BCB 6, and this is
my question.
When clicking the button
the code is this...[...]


I think you'll be much better off asking in a BCB-specific newsgroup.
Try 'borland.public.cppbuilder.language' or something similar.
Jul 23 '05 #2

"Victor Bazarov" <v.********@comAcast.net> skrev i melding
news:r4********************@comcast.com...
: "Torbjorn Morka" <la****@ticali.no> wrote...
: >I am currently working with a small program using BCB 6, and this
is
: > my question.
: > When clicking the button
: > the code is this...[...]
:
: I think you'll be much better off asking in a BCB-specific
newsgroup.
: Try 'borland.public.cppbuilder.language' or something similar.
:

My ISP does not have any such group... :-(

Torbjorn.
:
Jul 23 '05 #3
try google (groups.google.com)
Edernity
--------
if it help (IT DON'T CAUSE YOU A CENT. JUST 1 EMAIL THEN FILLING FORMS)
please do help me provide better school supplies for childrenof
indonesia.
IN FACT, for those other who already read this plea and maybe finding
my post helpful, what is I give you one dollars for it. I don't believe
this, I'm paying to get people to donate to kids?!!!???that really
ugly!
it may be a donation but I merely ask you to letme send email to you
from one of the product of I'm affiliated and please register there on
mechant account free. If you even want you refund back on your dollar
of i-kard, its ok, I'll send you just use regular delivery on shipping
please. Please note this is very safe since this is a bonafid company.
remember your credit card company will confirm you on your purchase.
u can add or remove more credit cards into your account. you can/should
also ask for always confirmation on send out to you. That will get
those savage cracker bloke out. even u can use some more free teen
refillable visa/mastercard from your bank cc account (can be obtaion
free).
It is just unnerving seeing how can people do not do anything as so
they need so little. $10 could support {{{{{the child 1 month.}}}}
Still have doubts, sign on a personal account and let me contact you
again on it. just one mail pls
also
I'm also affiliated to this site:
www.getaportal.com/portals/eddy_ruslim
Unless u wanto e-gold it at 1369872
New to egold:www.e-gold.com/e-gold.asp?cid=1369872
NAH, previous way cost u zilch
God bless
Torbjørn Morka wrote:
"Victor Bazarov" <v.********@comAcast.net> skrev i melding
news:r4********************@comcast.com...
: "Torbjorn Morka" <la****@ticali.no> wrote...
: >I am currently working with a small program using BCB 6, and this
is
: > my question.
: > When clicking the button
: > the code is this...[...]
:
: I think you'll be much better off asking in a BCB-specific
newsgroup.
: Try 'borland.public.cppbuilder.language' or something similar.
:

My ISP does not have any such group... :-(

Torbjorn.
:


Jul 23 '05 #4
Torbjørn Morka wrote:
: I think you'll be much better off asking in a BCB-specific
newsgroup.
: Try 'borland.public.cppbuilder.language' or something similar.
:

My ISP does not have any such group... :-(

Torbjorn.

And they are much inactive anyway. The better way is to use the Borland
web newsgroups, which are free to use and can find them in Borland's web
site:

http://www.borland.com

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #5
* 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.
You should put that in the program's 'main' or a function called by
'main'.

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...


It's very difficult to answer when you don't show any of the code, but
generally the initialization should go in a constructor, in your case
presumably TForm1::TForm1.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #6

"Alf P. Steinbach" <al***@start.no> skrev i melding
news:42*****************@news.individual.net...
: * 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.
:
: You should put that in the program's 'main' or a function called by
: 'main'.
:
:
: > 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...
:
: It's very difficult to answer when you don't show any of the code,
but
: generally the initialization should go in a constructor, in your
case
: presumably TForm1::TForm1.
:
TForm1 *Form1;
//--------------------------------------------------------------------
-------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Randomize;
}
//--------------------------------------------------------------------
-------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
int lottotall[6];
int i, a, j, temp;
for (i = 0; i < 6; i++) {
lottotall[i] = 0; //empty the array
lottotall[i] = random(48)+1; //6 random numbers
}
{
int a, j, temp;// this is supposed to be sorting routine, not
functional...
do
for(a = 0; a < 6; a++) {

for (j = 0; j < 6; j++) {
if (lottotall[a] > lottotall[a+1])
{
temp = lottotall[j];
lottotall[j] =
lottotall[j+1];
lottotall[j+1] = temp;
}
}
}
while (lottotall[a] > lottotall[a+1]);
}
Edit1->Text = lottotall[0];
Sleep(100);
Application->ProcessMessages();
Edit2->Text = lottotall[1];
Sleep(100);
Application->ProcessMessages();
Edit3->Text = lottotall[2];
Sleep(100);
Application->ProcessMessages();
Edit4->Text = lottotall[3];
Sleep(100);
Application->ProcessMessages();
Edit5->Text = lottotall[4];
Sleep(100);
Application->ProcessMessages();
Edit6->Text = lottotall[5];
Sleep(100);
Application->ProcessMessages();
}

The ideal was
Do the random picking of numbers
Check if someone are equal, if so do it again.
If not check if number[a] > number[a+1], if not compare with all the
rest
(must compare with some Delphi i did previous)

Torbjorn.

: --
: A: Because it messes up the order in which people normally read
text.
: Q: Why is it such a bad thing?
: A: Top-posting.
: Q: What is the most annoying thing on usenet and in e-mail?
Some kind of signatures too...
Jul 23 '05 #7

"Torbjørn Morka" <la****@ticali.no> wrote in message
news:5c*********************@news000.worldonline.d k...

"Victor Bazarov" <v.********@comAcast.net> skrev i melding
news:r4********************@comcast.com...
: "Torbjorn Morka" <la****@ticali.no> wrote...
: >I am currently working with a small program using BCB 6, and this
is
: > my question.
: > When clicking the button
: > the code is this...[...]
:
: I think you'll be much better off asking in a BCB-specific
newsgroup.
: Try 'borland.public.cppbuilder.language' or something similar.
:

My ISP does not have any such group... :-(


newsgroups.borland.com

Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Anand K Rayudu | last post by:
Hi All, I am new to python & want to build some GUI dialogs. Can some one please suggest some document reference. I am hoping that standard python install will have some GUI development...
3
by: Lorenzo Polidori | last post by:
Hi all, I have to display an MPEG2 stream in my C++ application. I have seen the Media Player Object of Borland C++Builder 6 can have as input a file specified in Filename property of this media...
2
by: Lotfi | last post by:
Hi I am trying to access MySQL DB with C++ Builder 6 pro, I have Apache 2 under W2000 pro and MySQL 4 I found http://crlab.com/mydac/ but it is not free :-( but the trial version seems to...
6
by: Verne | last post by:
Can anyone tell me where to look for some sample code programs for simple window developement by Builder 6 C++. I know the C++ fairly well but tryint to understand and learn how to use the...
0
by: Xproblem | last post by:
FTP Client Engine for C/C++ 2.4 Screenshot - Soft.comFTP Client Engine for C/C++ 2.4. ... System Requirements: Windows C/C++ compiler - Microsoft operating system: Windows 95, Windows 98, Windows...
2
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am...
10
by: surabhi | last post by:
A while ago I evaluated Eclipse vs Visual Studio, and settled on Visual Studio 2005. Eclipse is better in many ways, but the lack of a gui builder was the deciding factor. Visual Studio 2005 has an...
0
by: FluffyCat | last post by:
Last fall I started a series of design pattern examples using PHP5. I think the last pattern I did was the Singleton in January. Getting back to it here is my first cut at the Builder pattern. ...
2
by: sicapitan | last post by:
FYI, with something like this: hotelement = "hotelement"+hotcount; hotspot = Builder.node('div', { id:'hotspot'+hotcount, className:'hotspot', style:''+divstyle }, ) ]);
0
by: JosAH | last post by:
Greetings, Introduction Before we start designing and implementing our text builder class(es), I'd like to mention a reply by Prometheuzz: he had a Dutch version of the entire bible ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.