- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 5
- Posts with Upvotes
- 4
- Upvoting Members
- 3
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Software developer, freelancer.
Re: Are you doing something wrong. I've done, everything works fine. Show your code. | |
Re: Put a file with an example of work. This module was written by me for their own needs. You can easily rasshiret it to their needs. | |
Re: [CODE=Delphi] uses Math; .... var d: integer; begin d := RandomRange(10,100); end; [/CODE] | |
Re: Try to start counting from 1. I have not worked with the components, always use another method. I know that almost all the indices in the COM Excel ticking is from 1. | |
Re: Try this. I have not tested the speed. Just as an option. [CODE=Delphi] procedure TForm1.Button1Click(Sender: TObject); var List: TStringList; begin List:=TStringList.Create; try List.Assign(ListBox1.Items); List.CustomSort(TStringsSort); ListBox1.Items.Assign(List); finally List.Free; end; end; function TStringsSort(List: TStringList; Index1, Index2: Integer): Integer; begin Result:=-CompareStr(List[Index1],List[Index2]); end [/CODE] | |
Re: Use COM. fObject := CreateOleObject('Excel.Application'); | |
Re: Just Draw in the OnPaint event and everything will be okay. Or call the drawing functions from this event. In this matter, I gave an example (attached file): [url]http://www.daniweb.com/software-development/pascal-and-delphi/threads/356130[/url] | |
Re: Project -> Options -> Application -> Enable Runtime Themes - uncheck this | |
Re: [CODE] nas := 0; for i:=1 to 80 do begin naspole1[i]:=pole1[i]*pole2[i]+nas; if naspole1[i] >= 10 then begin naspole1[i] := naspole1[i] div 10; nas := naspole1[i] mod 10; end; write(naspole1[i]); end; [/CODE] | |
Re: TLabel that can not do. Tsf need to use the DrawText API function with the keys: DT_CENTER + DT_VCENTER + DT_SINGLELINE Pre TRect specify where you want to write an inscription. If you do not know what size is needed, then add key DT_CALCRECT. When this key TRect will be … | |
Re: Something like: [url]http://www.delphisources.ru/pages/faq/base/create_new_table.html[/url] For more information, read the help for Delphi | |
Re: use message WM_COPYDATA [url]http://www.delphisources.ru/pages/faq/base/wm_cd_link.html[/url] [URL="http://www.kansoftware.ru/?tid=4936"]http://www.kansoftware.ru/?tid=4936[/URL] | |
Re: Learn to read the documentation. The note says it all. I already wrote that you invented the wheel in an array. Now you again that it invents. It's time to read and not poke your finger into the sky. way 1 [CODE=Delphi] procedure TSecondForm.Button1Click(Sender: TObject); var bmp: TBitmap; idx: Integer; … | |
Re: Query.Parameters.ParamByName('DateReceived').AsDateTime := Invoice.DateReceived; P.S.: date can be increased simply, use IncDays/DecDays (in DateUtils) Invoice.DateReceived := DateUtils.IncDays(now,2); | |
Re: Examine carefully classes. You invented the wheel. Note the two properties have TForm1 - Controls [], and Components []. Number of them ControlsCount and ComponentsCount. You put in design time 32 TImage component on TForm1. Hence Form1 already contains an array of pointers. Likewise, instead of TForm could be such … | |
Re: [url]http://sourceforge.net/projects/dspack/[/url] [url]http://delphiexpert.ru/load/Components/dspack2006.zip[/url] | |
Re: [CODE=DELPHI] function IntToBin( Value: integer; Digits: integer ): string; begin result := StringOfChar ( '0', digits ) ; while value > 0 do begin if (value and 1) = 1 then result[digits] := '1'; dec (digits) ; value := value shr 1; end; end; [/CODE] | |
Re: You better take advantage of the components of Indy (TidHTTP) and use threads TThread. | |
Re: [CODE=Delphi] // Static show procedure TForm1.Button1Click(Sender: TObject); begin // Form2.Show; Form2.ShowModal; end; // dynamic creation, show, free procedure TForm1.Button1Click(Sender: TObject); begin with TForm2.Create(self) do try if ShowModal = mrOK then ShowMessage('Hello world!') else ShowMessage('Bye world!') finally Free; end; end; [/CODE] | |
Re: [CODE=Delphi] procedure Wait(ms: integer); var bt: DWORD; begin bt := GetTickCount; while (GetTickCount - bt) < ms do Application.ProcessMessages; end; [/CODE] | |
Re: for delphi: [CODE=Delphi] procedure Wait(ms: integer); var bt: DWORD; begin bt := GetTickCount; while (GetTickCount - bt) < ms do Application.ProcessMessages; end; [/CODE] | |
Re: 1. You can use the class object list TObjectList. Only need to take care of his creation and removal. [CODE=Delphi] private btn: TObjectList; procedure TForm1.FormClick(Sender: TObject); begin with Btn.Items[Btn.Add(TButton.Create(Self)] do begin OnClick := ButtonClick;; Left := 8; Top := (((Btn.Count - 1) * Height) + 8); Parent := Self; end; … | |
Re: Need to program but decide what the flag state or leaving any other sign for the program B. | |
Re: In pocet what value? Do that and will be happy: [CODE=Delphi] function kolik(pocet:integer; retez: string):integer; const pocent = 5; var p: array[1..pocet] of integer; pomocna,j,i,k,l,od,nep:integer; [/CODE] | |
Re: No need touse Timer. It is not safe (low priority) and is not correct. The correct solution would be to use the component and its TActionList. This component is specifically designed to do this. It gives a centralized management of form elements. Sure to check out and see the attached … | |
Re: [code=delphi] with TStringList.Create do try LoadFromFile('a.txt'); SaveToFile('b.txt'); finally Free; end; [/code] or WinAPI BOOL CopyFile( LPCTSTR lpExistingFileName, // pointer to name of an existing file LPCTSTR lpNewFileName, // pointer to filename to copy to BOOL bFailIfExists // flag for operation if file exists ); | |
Re: Use TThread. |