ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Borland C++ Builder Contest

Learning C++ Builder

<< < (4/5) > >>

Shed:
b) how to have listed functions ordered alphabetically?
--- End quote ---

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();       
}
/

mouser:
shed, i think smirf was asking about BDS functions in the ide to list properties and methods of components alphabetically..

Shed:
yes...but i don't know if the compiler have it....

well...at least the CodeCompletion have (right click on codecompletion window)

- Sort by Scope
- Sort by Name

Smirf:
... i think smirf was asking ...-mouser
--- End quote ---

The problem seems to be, that some basic functionalities seem to have vanished since upgrading from BCB6 to BDS2006. So I was asking for to help me how to use them again, thinking that I may have not fully understood, how to use the new Borland Developer Studio correctly.

The mostly missed abilities of the IDE are, how to insert assistedly new to be self written procedures, and how to list existing methods alphabetically. It seems for me, that those abilities have been shifted to the Together functionality e.g. in the Delphi personality. But, because of that this is not present in the C++ personality, those components seem to have completely vanished without any substitute. Am I right? Or what to do otherwise?

Reinhard.

Smirf:
... the CodeCompletion ...-Shed
--- End quote ---

Well, that does not help to locate the code of the to be found function. Because I do not have all those names exactly in my head, I am used to walk through an alphabetically sorted list of all methods, to finally navigate to a desired code block. CodeCompletion is not usable to solve that common kind of working within a big solution.

Reinhard.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version