Perhaps, some people say....wow...Visual Programming it's very hard for me....i need begin older stylish...with a console application, (ok good...the IDE of C++ Builder also allow console applications....)
For it, you need Click on the main top menu File->New->Other ....and select Console Wizard (this is for generating the new project for a console application)
Console wizard allows select kind of languaje (C or C++) and if it's multithreaded, etc...
when you create the console, you've the standard *.c or *.cpp file for procedural coding
here, you can write old style coding...things like main function with arguments....void main(int argc, char argv[])...
this is,...C standard coding...
//---------------------------------------------------------------------------
#pragma hdrstop
#include <conio.h>
#include <stdio.h>
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
int x = 0;
clrscr(); //this function clear the text screen
for(x=1; x<12; x++)
{
//we use gotoxy function for place the cursor
//and print 12 Hello world to screen
gotoxy(30,x);
printf("hello world");
}
getch(); //wait keystoke by user for exit
}
b) how to have listed functions ordered alphabetically?
you can made a standalone utility for it...like this...
then
1) got to *.H or HPP header file...Ctrl+C for copy the block of functions, and paste on this memo,
2) click on button1 (for sort the Memo (results will be duplicated/added to Memo1 text....then you copy and replace at Header file)
very tricky...sure...function_array only manages 100 lines...take care with this
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <string.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int sort_function( const void *a, const void *b);
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
char function_array[100][150];
AnsiString TEMP_STRING;
int lines_of_memo=0;
int counter_1 = 0;
lines_of_memo = Memo1->Lines->Count;
if(lines_of_memo <= 0)
{ ShowMessage("memo is empty"); return;}
Memo1->Lines->Add("******************************************************************************");
while(counter_1 < lines_of_memo)
{
TEMP_STRING = Memo1->Lines->Strings[counter_1].c_str();
strcpy(function_array[counter_1], TEMP_STRING.c_str());
counter_1++;
}
int x;
qsort((void *)function_array, lines_of_memo, sizeof(function_array[0]), sort_function);
for (x = 0; x < lines_of_memo; x++)
Memo1->Lines->Add(function_array[x]);
Memo1->Refresh();
}
//---------------------------------------------------------------------------
int sort_function( const void *a, const void *b)
{
return( strcmp((char *)a,(char *)b) );
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Memo1->CopyToClipboard();
}
/