كيف يمكن قلب النصوص مع الاسطر الاعلى يصبح اسفل والعكس
#1
السلام عليكم
سؤال تنشيط الاذهان
مثلا
إقتباس :16. Fix bug "Switch to found results window" command now switches back to the current edit view if the focus is already on the found results.
17. Fix the search result inaccurate colorization bug.
18. Fix the Mark all in selection bug (while Find Replace Dialog loosing the focus).
19. Add 2 plugins messages : NPPN_FILEBEFORELOAD and NPPN_FILELOADFAILED.
20. Fix New document not be switched while double clicking in Find in files result panel.
21. Fix conversion min to Maj and Maj to min (or vice et versa) in column selection bug.
22. Fix bug when the find dialog was closed the translucaent shadow remained in Windows 7.
23. Fix crash bug of find in files feature.
24. Add "follow current doc" checkbox in Find in file dialog.
25. Add the ability of tag match feature to not highlight comment zone in html/xml.
26. Fix TCL language highlighting bug.

المطلوب قلب الاسطر + عكس الكلمات
right to lift & lift to right

تحياتي
الرد
#2
و عليكم السلام و رحمة الله
كود :
function strInverse( const _chaine: string ): string; var x : integer; begin for x :=length( _chaine ) downto 1 do begin Result:= Result + copy( _chaine , x, 1 ) end; end;
بالتوفيق Smile
الرد
#3
وعليكم السلام ورحمة الله

كمثال باستخدام مكونين Memo واحد لاحتواء النص الاصلي والثاني لعرض النص بعد التعديل
مكون ListBox كوسيلة لقلب الكلمات وزر Button
نضع النص بمحتوى المكون Memo1 ونكتب بالزر شيئ مثل
كود :
Var i,j : integer; s : String; begin Memo2.Clear; for i:= Memo1.Lines.Count-1 downto 0 do begin s := Memo1.Lines[i]; s := copy(s,1,length(s)-1); ListBox1.Items.CommaText := s; s := ListBox1.Items[0]; for j:= ListBox1.Items.Count-1 Downto 1 Do s := s+' '+ListBox1.Items[j]; Memo2.Lines.Add(s+'.'); end; end;
حاول فهم الكود!


الملفات المرفقة
.rar   swap lines words delphi example.rar (الحجم : 1.37 ك ب / التحميلات : 15)
الرد
#4
ممتاز ياملك
هنا يحصل خطا عند استخدام TStringList
لماذا لا نستغني عن Object
كود :
procedure TForm1.BitBtn1Click(Sender: TObject); Var i, j, c: integer; s: String; t:TStringList ; begin Memo2.Clear; j := c ; t := TStringList.Create(); try t.Text :=Memo1.Text ; for i :=0 to (t.Count - 1)div 2 do begin t.Exchange(i, t.Count-c); s := t.Strings[i]; // Memo1.Text := t.Text ; inc(c); s := copy(s, 1, length(s) - 1); t.CommaText := s; s := t.Strings[0]; for j := t.Count - 1 Downto 1 Do s := s + ' ' + ListBox1.Items[j]; Memo2.Lines.Add(s + '.'); end; Memo2.Text := s ; // t.Text finally t.Free; end; end;
الرد
#5
المشكلة هنا ListBox1.Items[j];
الرد
#6
الحل
[صورة: picture0001n.png]
كود :
function GetSwapText(InTex: string): string; Var i, j, c: integer; s: String; t, m, R: TStringList; begin c := 1; t := TStringList.Create(); m := TStringList.Create(); R := TStringList.Create(); try t.Text := InTex; for i := 0 to (t.Count - 1) div 2 do begin t.Exchange(i, t.Count - c); inc(c); end; for i := 0 to (t.Count - 1) Do begin s := t.Strings[i]; s := copy(s, 1, length(s) - 1); m.CommaText := s; s := m.Strings[0]; for j := m.Count - 1 Downto 1 Do s := s + ' ' + m.Strings[j]; R.Add(s + '.'); end; result := R.Text; finally t.Free; m.Free; R.Free; end; end;
الرد
#7

إقتباس :هنا يحصل خطا عند استخدام tstringlist
المثال اعددته على دلفي 5
استخدام اصدار دلفي احدث بحاجة لتعديل طفيف هنا أو هناك
إقتباس :لماذا لا نستغني عن object
يمكن،عند طرح حل سريع احاول استخدام المكونات المرئية لايصال الفكرة، طبعا في حالة برنامج/تطبيق الحل قد يكون مختلف

لا ادري ان انتبهت لحذف النقطة من أخر كل سطر و ايضا الترقيم عند بداية كل سطر قبل عملية قلب الكلمات
الرد
#8
والله ما قصرت
وفيت
الرد
#9
شكرا لكم وشكرا لمعلوماتكم القيمه
الرد


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم