- 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.
67 Posted Topics
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. | |
Re: Read more about "design patterns". "Memento" - what you need. [url]http://en.wikipedia.org/wiki/Design_pattern_(computer_science[/url]) | |
Re: if "infor[1].name" is string, then is very simple. [CODE=Delphi] var S: string; P: integer; begin S := 'infor[1].name'; P := Pos('.',S); if P > 0 then Delete(S,P,1); end; [/CODE] if the "infor[1]" - an object, then you need to read a book on OOP or career change. | |
Re: [CODE=Delphi] type TDataBytes = array[0..1023] of byte; TOnData = procedure(const Buff: TDataBytes; const DataLen: word); Olaylar = class private FOnRx: TOnData; FOnTx: TOnData; procedure SetOnRx(const Value: TOnData); procedure SetOnTx(const Value: TOnData); published property OnRx: TOnData read FOnRx write SetOnRx; property OnTx: TOnData read FOnTx write SetOnTx; end; procedure Olaylar.SetOnRx(const Value: … | |
Re: It's very simple. Use components Indy (TIdHttp) [url]http://www.delphigroups.info/2/5/487672.html[/url] or [url]http://www.realthinclient.com/[/url] (TrtcHttpClient) | |
Re: [Code=Delphi] uses MPlayer, MMSystem; const MCI_SETAUDIO = $0873; MCI_DGV_SETAUDIO_VOLUME = $4002; MCI_DGV_SETAUDIO_ITEM = $00800000; MCI_DGV_SETAUDIO_VALUE = $01000000; MCI_DGV_STATUS_VOLUME = $4019; type MCI_DGV_SETAUDIO_PARMS = record dwCallback: DWORD; dwItem: DWORD; dwValue: DWORD; dwOver: DWORD; lpstrAlgorithm: PChar; lpstrQuality: PChar; end; type MCI_STATUS_PARMS = record dwCallback: DWORD; dwReturn: DWORD; dwItem: DWORD; dwTrack: DWORD; end; … | |
Re: Very simple. In the main form, you give a link to the second module. In the main module creates an event handler by pressing a button and write code like this (in the second module does not need links to the main module): [CODE=Delphi] unit MainForm; .......... uses SecondForm; TMainForm.Button1Clicck(Sender: … | |
Re: Read help for PowerPoint for method Delphi&PP [url]http://www.swissdelphicenter.ch/torry/showcode.php?id=1005[/url] [url]http://www.delphimaster.ru/cgi-bin/forum.pl?id=1248689692&n=8[/url] [url]http://www.delphisources.ru/pages/faq/base/powerpoint_ole.html[/url] | |
Re: Before asking a question, you need to search. Perhaps someone has already done so on. [URL="http://www.daniweb.com/code/snippet216536.html"]http://www.daniweb.com/code/snippet216536.html[/URL] | |
Re: This problem for students. I do not see the code that you can not. Formula for calculating a leap year is known to all. [Code=Delphi] Result := ((Year mod 4) = 0) and ((Year mod 100) <> 0) or ((Year mod 400) = 0); [/Code] Algorithm for computing is very … | |
Re: [code=Delphi] var i: integer; Source, Dest: string; Chars: array[32..127] of Char; begin try Source := ''; Dest := ''; ReadLn(Source); for i := 1 to Length(Source) do if not (Chars[Ord(Source[i])] <> '') then begin Chars[Ord(Source[i])] := Source[i]; Dest := Dest + Source[i]; end; WriteLn(Dest); end; [/code] | |
Re: [code=Delphi] var Start: integer; begin Start := GetTickCount; ...... // your code .... ShowMessage(IntToStr(GetTickCount - Start)); // Msec end; [/Code] | |
| |
Re: 1. Use the function IOResult that would find the error code. 2.Try this: CreateFile(pchar(filename),GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ or FILE_SHARE_WRITE,nil,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,0); | |
Re: Where is the code? What exactly does not work? | |
Re: I think my code is much smaller. Less code = fewer bugs. Сan just not give enter other characters. Put on the shape of TEdit. Create his handler OnKeyPress and paste the following code: [CODE=Delphi] procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if Key in ['-','0','1','2','3','4','5','6','7','8','9',#8,DecimalSeparator] then begin if (Key … | |
Re: Possible. Just a little bit differently. [CODE=Delphi] TBookName = string[20]; TPDFLink = string[200]; BookLibrary = record AuthorName: String[20]; BookName: Array[1..20] of TBookName; PDFLink: Array[1..20] of TPDFLink; end; [/CODE] | |
Re: To do this, use any database. If it is not possible, then recommend the use of "linked list". [url]http://en.wikipedia.org/wiki/Linked_list[/url] | |
Re: Yes, as a way [CODE=Delphi] procedure OnTimer(Sender: TObject) begin WriteLn('The time has ended'); end; var Timer: TTimer; TimerDelay: integer; begin Randomize; TimerDelay = 10 + Random(50); Timer := TTimer.Create(self); Timer.Interval := TimerDelay; Timer.OnTimer := OnTimer; end; [/CODE] |
The End.