Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Backwards search / Rückwärtssuche

Reply
Thread Tools

Backwards search / Rückwärtssuche

 
 
Peter Merz
Guest
Posts: n/a
 
      12-28-2004
Englisch:
Rear one, I have the following problem, I a program wrote, in which
one cannot look for it from above downward clicks one in the field
however from down upward, goes.

I must sketch now an algorithm, which scans a text upward, there my
program (power ++ of Sybase) such a function as standard equipment do
not provide.

The code for forward-searches:



German:

Hi,
Ich habe folgendes Problem, ich habe ein Programm geschrieben, in dem man
von oben nach unten suchen kann. klickt man im Feld jedoch von unten nach
oben, geht es nicht.

Ich muss nun einen Algorithmus entwerfen, der nach oben einen Text
durchsucht, da mein Programm (Power ++ von Sybase) eine solche Funktion von
Haus aus nicht mitliefert.

Der Code für die vorwärtssuche:

if (event->findNext)
{
suchtext = Suchen_Ersetzen_Dialog_1->GetFindText();
if (event->searchDown)
{
position = Richtextfeld_1->FindText( suchtext, FALSE, ganzwort,
beginAt );
if (position < 0)
{
position = Richtextfeld_1->FindText(suchtext);
}
text_laenge = suchtext.GetLength();
zeichen_index.start = position;
zeichen_index.end = position + text_laenge;
beginAt = zeichen_index.end;

Richtextfeld_1->SetFocus( );
Richtextfeld_1->SetEditSelection( zeichen_index );
}
else
{

//hier muss die Rückwartssuche rein!!!


}


}




return FALSE;
}



Englisch:

Into the elsespalte now the Rueckwaertssuche should purely. A
Richtextfeld is scanned. The program which I use is Power++ of Sybase.
The variable beginAt indicates the current cursor position in the
text.

Over each assistance I am grateful!



German:
In die elsespalte sollte nun die Rückwärtssuche rein. Es wird ein
Richtextfeld durchsucht.
Das Programm das ich nutze ist Power++ von Sybase.
Die Variable beginAt gibt die aktuelle Cursorposition im Text an.

Über jede Hilfe bin ich dankbar!


 
Reply With Quote
 
 
 
 
ox
Guest
Posts: n/a
 
      12-28-2004
You might want to consider std::search and std::reverse_iterator.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search a Large files backwards mud_saisem Perl Misc 7 03-02-2010 10:05 PM
| SEO , Search Engine Optimizer, SEARCH OPtiMIzAtIoN with SeaRch OPtiMizer optimizer.seo@gmail.com Digital Photography 0 04-22-2007 04:20 AM
String search backwards? Toby DiPasquale Ruby 1 01-24-2006 08:22 PM
search within a search within a search - looking for better way...my script times out Abby Lee ASP General 5 08-02-2004 04:01 PM
Search for a string backwards in a file. SK C++ 15 06-17-2004 08:34 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57