나는 몇 천 개 항목이 들어있는 문자열 목록 (TStrings)을 가지고 있습니다. 100 개 단위로 처리해야합니다. 기본적으로 루프를 수행하는 가장 좋은 방법은 Delphi에서 무엇인지 알고 싶습니다. 나는 그것을 파악하려고 할 때 벽돌 벽을 때리고있다.Delphi - 데이터를 올바르게 페이지하는 방법
감사
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
Uses math;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
I:Integer;
pages:Integer;
str:string;
begin
pages:= ceil(memo1.Lines.Count/100) ;
memo2.Lines.add('Total Pages: '+inttostr(pages));
memo2.Lines.add('Total Items: '+inttostr(memo1.Lines.Count));
// Should just do in batches of 100 VS entire list
for I := 0 to memo1.lines.Count - 1 do
begin
if str > '' then
str:= str+#10+ memo1.Lines.Strings[i]
else
str:= memo1.Lines.Strings[i];
end;
//I need to stop here every 100 items, then process the items.
memo2.Lines.Add(str);
end;
end.
예 양식
object Form2: TForm2
Left = 0
Top = 0
Caption = 'Form2'
ClientHeight = 245
ClientWidth = 527
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Memo1: TMemo
Left = 16
Top = 8
Width = 209
Height = 175
Lines.Strings = (
'4xlt columbia thunder storm jacket'
'5 things about thunder storms'
'a thunder storm with a lot of thunder '
'and lighting sccreensaver'
'a thunder storm with a lot of thunder '
'and lighting screensaver with no nag '
'screens'
'all about thunder storms'
'all about thunderstorms for kids'
'amazing tornado videos and '
'thunderstorm videos'
'are thunder storms louder in ohio?'
'bad thunder storms'
'bathing in thunder storm'
'best thunderstorm pictures'
'cartoon thunder storms'
'celtic thunder storm'
'central valley thunder storm'
'chicago thunderstorm pictures'
'cool thunderstorm pictures'
'current thunderstorm warnings'
'does thunder storms in december mean '
'snow will be coming'
'facts about thunderstorms for kids'
'facts on thunderstorms for kids'
'fedex thunderstorm video'
'florida thunderstorms facts'
'free relaxing thunderstorm music'
'free soothing thunderstorm sounds '
'online'
'free thunderstorm mp3'
'free thunderstorm mp3 download'
'free thunderstorm mp3 downloads'
'free thunderstorm mp3s'
'free thunderstorm music'
'free thunderstorm pictures'
'free thunderstorm sound effects'
'free thunderstorm sounds'
'free thunderstorm sounds cd'
'free thunderstorm sounds mp3'
'free thunderstorm sounds online'
'free thunderstorm soundscape'
'free thunderstorm video'
'free thunderstorm video download'
'free thunderstorm videos'
'god of storm and thunder'
'horses storm thunder rain'
'how do thunder storms form'
'how far away is a thunder storm'
'how long do thunder storms last'
'ice cube in a thunder storm'
'indoor thunderstorm safety tips'
'information about thunderstorms for kids'
'interesting thunderstorm facts'
'is it dangerous to shower during thunder '
'storm'
'is there frequently thunder during snow '
'storms'
'isolated thunderstorms'
'it'#39's just a thunder storm baby there is '
'nothing you should fear lyrics'
'lightning & thunder storm safety'
'lightning and thunderstorm facts'
'lightning and thunderstorms facts'
'lightning and thunderstorms for kids'
'listen to thunderstorm sounds online'
'mississauga thunder storm'
'nature sounds free mp3 thunder storm'
'only about thunderstorms facts'
'original storm deep thunderstick'
'phone use during thunder storms'
'pictures of thunderstorms'
'pocono thunder storm'
'posters of thunder storms'
'power rangers ninja storm'
'power rangers thunder storm'
'power rangers thunder storm cast'
'power rangers thunder storm games'
'power rangers thunder storm morphers'
'power rangers thunder storm part 1'
'power rangers thunder storm part 2'
'power rangers thunderstorm'
'power rangers thunderstorm cannon'
'power rangers thunderstorm deluxe '
'megazord'
'power rangers thunderstorm games'
'power rangers thunderstorm megazord'
'power rangers thunderstorm part 2'
'power rangers thunderstorm pictures'
'power rnager ninja storm thunder staff'
'powerful thunder and lightning storms'
'precambrian thunder storms'
'rain thunderstorm mp3'
'rain thunderstorm pictures'
'relaxing thunderstorm music'
'reminds me of ohio river thunder lighten '
'storms'
'sacramento thunder storm'
'safety tips for when your caught in a '
'thunder storm'
'scattered thunderstorms'
'schemer puts his head in the thunder '
'storm'
'sedative thunder storm'
'server thunder storms'
'severe supercell thunderstorm pictures'
'severe thunder storm pictures'
'severe thunder storms'
'severe thunderstorm facts'
'severe thunderstorm pictures'
'severe thunderstorm pictures hail'
'severe thunderstorm pictures in alberta'
'severe thunderstorm pictures tornado'
'severe thunderstorm safety'
'severe thunderstorm safety tips'
'severe thunderstorm videos'
'severe thunderstorm warning'
'severe thunderstorm warning los '
'angeles'
'severe thunderstorm warning signs'
'severe thunderstorm warnings'
'severe thunderstorms'
'severe thunderstorms facts'
'shakespeare use thunder storm for '
'cosmic disorder julius caesar'
'soothing thunderstorm sounds online'
'sound effects of severe thunder storm'
'sound of rain storm finger snapping '
'thunder chorus'
'split thunder storm'
'storm 3d thunder power'
'storm dark thunder'
'storm dark thunder bowling ball'
'storm dark thunder bowling ball sale'
'storm dark thunder for sale'
'storm dark thunder pearl'
'storm dark thunder pearl bowling ball'
'storm dark thunder review'
'storm dark thunder shirt'
'storm dark thunderball'
'storm deep thunder'
'storm deep thunder 11'
'storm deep thunder 15'
'storm deep thunder 15 lure'
'storm deep thunder 2'
'storm deep thunder lures'
'storm deep thunderstick'
'storm deep thunderstick crankbaits'
'storm deep thunderstick dts09'
'storm deep thunderstick jr'
'storm deep thunderstick lures'
'storm deep thundersticks'
'storm rolling thunder 3 ball roller'
'storm rolling thunder bowling bag'
'storm rolling thunder three ball bowling '
'bag'
'storm shallow thunder'
'storm shallow thunder 15'
'storm thunder claw'
'storm thunder craw'
'storm watches thunder'
'storms with constant lightning and '
'thunder non-stop'
'supercell thunder storms'
'supercell thunderstorm pictures'
'supercell thunderstorms'
'swimming pools thunder storms'
'tampa + lightning strikes + thunder '
'storms'
'texas thunderstorm pictures'
'texas thunderstorm warnings'
'thunder and lightning storm'
'thunder and lighting storms'
'thunder and lightning storms'
'thunder bay snow storm video'
'thunder storm'
'thunder storm and windmill'
'thunder storm cd'
'thunder storm cloud'
'thunder storm clouds'
'thunder storm dog peppermint oil'
'thunder storm in winter'
'thunder storm in winter and weather '
'prediction'
'thunder storm lx-3 & road blaster psx '
'download'
'thunder storm occurances'
'thunder storm photos'
'thunder storm poems'
'thunder storm safety'
'thunder storm sign'
'thunder storm sounds'
'thunder storms'
'thunder storms and deaths'
'thunder storms and ilghting'
'thunder storms and lighting'
'thunder storms cd'
'thunder storms in the arctic arctic '
'weather'
'thunder storms in winter'
'thunder storms on you tub'
'thunder storms pics'
'thunder storms with rain'
'thunderstorm'
'thunderstorm backgrounds'
'thunderstorm capital'
'thunderstorm capital 2008 dorfman'
'thunderstorm capital in boston'
'thunderstorm capital llc'
'thunderstorm capital of canada'
'thunderstorm capital of the us'
'thunderstorm capital of the world'
'thunderstorm facts'
'thunderstorm facts for kids'
'thunderstorm facts hail'
'thunderstorm facts tornadoes'
'thunderstorm mp3'
'thunderstorm mp3 download'
'thunderstorm mp3 download free'
'thunderstorm mp3 downloads'
'thunderstorm mp3 downloads free'
'thunderstorm mp3 files'
'thunderstorm mp3 free'
'thunderstorm mp3 free download'
'thunderstorm mp3 free downloads'
'thunderstorm mp3 torrent'
'thunderstorm mp3s'
'thunderstorm music'
'thunderstorm music cd'
'thunderstorm music downloads'
'thunderstorm music free'
'thunderstorm music playlists'
'thunderstorm music rain'
'thunderstorm pics'
'thunderstorm pictures'
'thunderstorm pictures for kids'
'thunderstorm safety'
'thunderstorm safety for kids'
'thunderstorm safety precautions'
'thunderstorm safety procedures'
'thunderstorm safety rules'
'thunderstorm safety tips'
'thunderstorm safety tips for kids'
'thunderstorm safety tips shelter'
'thunderstorm safety tips trees'
'thunderstorm sound effects'
'thunderstorm sound effects cd'
'thunderstorm sound effects download'
'thunderstorm sound effects free'
'thunderstorm sound effects free '
'download'
'thunderstorm sound effects free music '
'feature audio'
'thunderstorm sound effects mp3'
'thunderstorm sound effects rain'
'thunderstorm sounds'
'thunderstorm sounds cd'
'thunderstorm sounds download'
'thunderstorm sounds for sleep'
'thunderstorm sounds for sleeping'
'thunderstorm sounds free'
'thunderstorm sounds free download'
'thunderstorm sounds free downloads'
'thunderstorm sounds mp3'
'thunderstorm sounds mp3 download'
'thunderstorm sounds mp3 free'
'thunderstorm sounds online'
'thunderstorm sounds online for free'
'thunderstorm sounds online free'
'thunderstorm sounds sleep'
'thunderstorm sounds streaming'
'thunderstorm sounds torrent'
'thunderstorm soundscape'
'thunderstorm soundscapes'
'thunderstorm video'
'thunderstorm video clips'
'thunderstorm video download'
'thunderstorm video downloads'
'thunderstorm videos'
'thunderstorm videos for kids'
'thunderstorm videos lightning'
'thunderstorm videos online'
'thunderstorm wallpaper'
'thunderstorm warning'
'thunderstorm warning brisbane'
'thunderstorm warning definition'
'thunderstorm warning los angeles'
'thunderstorm warning san diego'
'thunderstorm warning san mateo county'
'thunderstorm warning santa barbara'
'thunderstorm warning santa clara'
'thunderstorm warning santa clara '
'county'
'thunderstorm warning signal'
'thunderstorm warning signs'
'thunderstorm warning vs watch'
'thunderstorm warnings'
'thunderstorm warnings and watches'
'thunderstorm warnings for nj'
'thunderstorm warnings qld'
'thunderstorms'
'thunderstorms facts'
'thunderstorms facts for kids'
'thunderstorms for kids'
'tornados and thunder storms animated'
'understanding thunderstorms for kids'
'watch thunderstorm videos'
'weather underground forecast '
'thunderstorms'
'what causes thunder storms'
'what is a thunder storm'
'where d thunder storms occur')
TabOrder = 0
end
object Memo2: TMemo
Left = 240
Top = 8
Width = 265
Height = 129
Lines.Strings = (
'Memo2')
TabOrder = 1
end
object Button1: TButton
Left = 384
Top = 184
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 2
OnClick = Button1Click
end
end
.NET 객체를 프로젝트에 사용합니까? 아마도 조금 더 정밀도가 정확하면 우리가 당신의 필요를 더 잘 이해하는 데 도움이 될 것입니다. 감사! –
아니요 일반 델파이를 사용합니다. 기본적으로 어떤 종류의 루프가 최상인지 궁금합니다. 사용. 그리고 어떻게 구조화해야하는지. – Brad
왜 한 번에 100 개를 처리해야합니까? 어떤 종류의 과정 그것은 당신이 즉시 모든 품목을 위해 할 수 있지 않는가, 그러나 당신은 실제적인 수에 관하여 진짜로 걱정하지 않는다는 것을이다? 시간이 걸리거나 사용자 인터페이서가 막히는 것에 대한 우려가 있습니까? 또는 각 처리 청크에 대한 데이터 세트 크기에 관한 것입니까? 또는 무엇을? –