FAQ Database Discussion Community


Delphi - scroll group of components on block overflow

delphi,overflow,components,delphi-7
I looked through such components like GroupBox, Panel, ScrollBox, ListBox, but nothing of them is what i am looking for. What i want is a component that will have a fixed size, no visible borders, preferaly non-color background and will allow to hide contained components if they overflow this component....

Need to enable button when text is entered in the edit boxes

delphi,delphi-7
I would like to use 2 TEdit item and a button for this. How can I check if all the Edit have some text value. After that i want to activate a button. Main form Onshow event: Btn1.Enabled:=false; if Edit1.text + Edit2.text have value then btn1.enabled:=true ? Thanks for the...

Operator not applicable to this operand when I try to make filter based on date

delphi,delphi-7
I am kind of new to Delphi and Query and before I posted this question, I searched everywhere that related to my problem but it seems I was unable to find anything that could help me solve my problem. I found this error message that operator not applicable to this...

delphi combination algorithm

delphi,delphi-7
Hello I cant write the combination algorithm. For example; I have 1 Red and 2 White balls and I want to write number red balls + number white balls. Like below; R->Red W->White RWW WRW WWR totally 3 combinasion I have. But How can I write it in Delpi? Because,...

Split up serial data in delphi

delphi,serial-port,delphi-7,delimiter,arduino-uno
I am a newbie in Delphi programming and I need some help. I have a problem with spliting my serial data. This is my code: procedure TForm1.ComPort1RxChar(Sender: TObject; Count: Integer); var DataByte : string; x, i: integer; save_data : TStringList; begin save_data := TStringList.create; for x := 0 to Count-1...

Delphi - Rate of clicking TImage slow compared with TButton

delphi,delphi-7
I have a form with both a TImage and a TButton control. I noticed the rate of responding to the OnClick event seemed a bit slow for the TImage (rapid clicking!) so I measured it. For 100+ clicks (and clicking as fast as I could, keeping the rate as consistent...

Call Web Service and Return Error in Delphi 7

web-services,delphi,wsdl,delphi-7,delphi-xe5
I have import a WSDL in Delphi 7 and Call a function on it and an error message will be displayed: Project Project1.exe raised exception class ERemotableException with message 'Server was unable to process request. ---> Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.'. Process...

TypeCasting : what is difference between below 2 lines of code?

delphi,delphi-7
what is the difference between below 2 lines of code. Both are trying to get the path and one is working and other is throwing error. i am working on Delphi-7 Path:= (((FFormOwner as TForm).Designer) as IDesigner).GetPrivateDirectory; --Working Path:= IDesigner(TForm(FFormOwner).Designer).GetPrivateDirectory ; --Error Below is the code which is using line...

PNGImage “Access violation” error at procedure end

delphi,png,delphi-7
I am using PNGImage library in my project, which entire GUI is made up of .png images, which i loaded to TImages at run-time. For some purposes i have to dynamically create plenty of components groups that are similar to each other. Every group consists of some TImages and have...

Difference between those declarations

delphi,parameters,delphi-7
I am learning Delphi since the beginning of this week and I am currently reading the Delphi 7 - Developer's Guide. In this book (Chapter 5-37), the author declares a function as follow: function FromEuro(const AValue: Double, Factor; FRound: TRoundToRange): Double; If I had to write this function, I would...

Overriding AsString in TFields and TStringField

database,delphi,delphi-7
When we swapped database components from ODBC Express to ADO one of the biggest problems we ran into was that ODBC Express "right-trimmed" the results from CHAR fields and ADO didn't. CHAR fields fill up their entire assigned field length so when we query them with ADO you get a...

How to go to definition of method or procedure in Delphi 7?

delphi,delphi-7
How to go to definition of method or procedure in Delphi 7? If ctrl key + mouse-click, it goes to the method declaration. I want it to go to the actual method instead, similar to "go to definition" in Visual Studio. Update: I want to jump to where proc2's code...

Why does This SQL query give a syntax error

mysql,sql,delphi,delphi-7
I have the following procedure which is executed on a button click (button1). After being prompted to log into the database, delphi throws the the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to...

MultiThreading and TCriticalSection on kylix

multithreading,performance,delphi,delphi-7,kylix
I maintain an application in Delphi 7 which have a server part that can be compiled with CrossKylix. For performance matter I'm benching multiThreading and Critical section use. I made a console application that create 100 TThread and each TThread compute a fibonacci. Then I add a critical section so...

Call C# .Net DLL in delphi 7 [duplicate]

c#,delphi,dll,com,delphi-7
This question already has an answer here: How to Create DLL in C# and call in Delphi XE6 1 answer Anyone know how can I create a C# dll which can be called in Delphi 7 program? I do that through the ComVisibleAttribute but delphi program takes error. C#...

TChromium not working after delete and create component again

delphi,delphi-7,tchromium
Here is my code: Home Button: LimparComponentes(Self); CriarTela(Janela, Self, Self.DsnStage); LimparComponentes Procedure: var myListWeb: TList; myListWeb := TList.Create; for i := 0 to Form.ComponentCount - 1 do begin if (Form.Components[i].ClassType = TNeocWebBrowser) then begin if ParentIsStage(TNeocWebBrowser(Form.Components[i])) then begin myListWeb.Add(Form.Components[i]); end; end end; for i := 0 to (MyListWeb.Count - 1)...

Incorrect Result of Total Download's Code

delphi,delphi-7
I use the following code to display the total download and upload. The problem arises when the cumulative download exceeds 2 GB, the result being the number of bits: var Form1: TForm1; Downloaded, Uploaded:integer; implementation {$R *.dfm} procedure TForm1.Timer1Timer(Sender: TObject); begin if Downloaded < 1024 then Recv.Caption := FormatFloat(' +...

What is significance of `NM_OPER_ON_VIEW: PChar = 'OnView'` as constant declaration?

delphi,delphi-7
Recently I have started working of one product which has been developed in delphi 5. While going through the code I stuck on one declaration in for constants which is as follows: const NM_OPER_ON_VIEW: PChar = 'OnView'; This type of notation is very new for me. Can any one tell...

Delphi 7 - perform operation if (var) = 1,3,5,7 etc

delphi,delphi-7
my Delphi 7 is very basic so I apologise in advance if this seems like a dumb question. I want my code to do something if a number is either 1 or 3 or 5 etc etc. or else do something else if it is 2 or 4 or 6...

Convert TMemoryStream to WideString in Delphi 7

delphi,delphi-7
When I use this code and function in Delphi 7 an error message will be displayed : This code convert MemoryStream content to WideString function ReadWideString(stream: TStream): WideString; var nChars: LongInt; begin stream.Position := 0; stream.ReadBuffer(nChars, SizeOf(nChars)); SetLength(Result, nChars); if nChars > 0 then stream.ReadBuffer(Result[1], nChars * SizeOf(Result[1])); end; procedure...

Delphi 7 - Save to a Specific .INI Files Name

delphi,delphi-7
I modified the MasterMan82's TIniFile code to read and write multi values from & to TEdit/TComboBox and TMemo. Forgive my vague questions, my english is not good. So, what I mean is: I have a couple of .INI files, A.ini, B.ini, C.ini ....and so on. I just store A.ini as...

Find property as TObject in Delphi 7

delphi,delphi-7,rtti
I have two type of classes like this in Delphi 7: TPhone = Class(TPersistent) private FNumber: string; published property Number: string read FNumber write FNumber; end; TPerson = class(TPersistent) private FFirstName: string; FPhone: TPhone; public constructor Create; published property FirstName: string40 read FFirstName write FFirstName; property Phone: TPhone read FPhone...

Missing operator or semicolon in Delphi 7

delphi,delphi-7
I've got the error message "Missing operator or semicolon" on line 38 of this code: procedure TForm1.SpinEdit1Change(Sender: TObject); begin case SpinEdit1.Value of 1: Label6.Caption('rok'); // line 38 end; end; end. Does somebody know what I am missing? Thank you....

How to remove a form from a unit while keeping the unit in the project?

forms,delphi,delphi-7
I use Delphi 7 and I encountered a very annoying thing. One of my projects has gone quite large and a form I used in one of the units became obsolete. I decided to get rid of it. It seems I can't. The IDE always asks for .dfm file, no...

Delphi: calling a method of a subclass from an Interface reference

delphi,interface,delphi-7
I have a set of classes that derive from a base class. The base class represents a generic service to be invoked (actually is a sort of REST client), and each derived class is a wrapper for each specific service (with specific parameters). Note that my base class implements an...

How to solve error 'DesignIntf.dcu' not found in Project (Not Package)

delphi,delphi-7,delphi-2010
I've done a lot of research before asking here so I already tried to add -LUDesignIDE to the compiler options. However it was enough to add 'DesignIDE' to the requires part of the package files but in my .exe files - so pure project files with some units - I...

Do something with each line in a Delphi TMemo

delphi,delphi-7
I need to read each line in memo1.lines and perform a specific action on it. I tried this: procedure TForm1.Button2Click(Sender: TObject); var zoznam: TStringList; Line: string; i : Integer; begin zoznam := TStringList.Create; zoznam.Assign(Memo1.Lines); for i := 0 to zoznam.Count-1 do begin edit1.Text := Memo1.Text; Button1.Click; end; end; However, it...

Split string by multiple characters in Delphi 7

delphi,split,delphi-7,tstringlist
I want to know how to split a string with multiple characters in Deplhi 7. I know how to split a string with one character: strlst := TStringList.Create; strlst.Delimiter := '^'; strlst.DelimitedText := receivedtext; And this is how I can split a string in Delphi XE7 with multiple characters. strlst...

How autocomplete in delphi?

delphi,autocomplete,delphi-7
I am using Delphi 7, when I write code in the unit, I want autocomplete the words of the tree's objects. For example, I have the next objets: LabelName, LabelEdge, LabelWindow, I want start write LabelN and have the possibility of autocomplete to LabelName. Is it possible?...

TADOConnection check for incorrect Credentials

mysql,delphi,delphi-7
I am using the following connection string: ADOConnection1.ConnectionString := 'Driver={MySQL ODBC 3.51 Driver};' + 'Server=db4free.net;Port=3306;' + 'Database=inventmanager;' + 'User=' + eUser.text + ';Password=' + ePass.Text + ';Option=3;'; eUser, and ePass being TEdits on the main form. When executing: ADOConnection1.Connected := true; Is their a way to test if the credentials...

Calculated fields are empty when using unidac in delphi 7

delphi,delphi-7,unidac
I am using unidac components in a Delphi 7 project to connect to a SQLite database. Connecting and quering works fine, except for calculated fields. My query is this : select c.CardID, c.FirstName, c.SurName, c.Street, c.City, c.PostCode, c.Points, (select count(1) from FullCard f where f.CardID = c.CardID and f.Paid =...

Delphi print memo to zebra printer

delphi,delphi-7
I need help. I have this code to print by zebra, and it prints nothing. procedure TForm1.Button3Click(Sender: TObject); var cm: AnsiString; zpl : TStringList; p: TPrinter; i: integer; begin p := Printer; zpl := TStringList.Create; memo2.Lines.Add('^XA'); memo2.Lines.Add('^LH5,5'); memo2.Lines.Add(concat ('^FO50,20^ADN,36,20^FD', edit1.text,'^FS')); memo2.Lines.Add(concat ('^FO35,60^ADN,15,10^FD', edit4.text,'^FS')); memo2.Lines.Add(concat ('^FO50,115^BCN,60,N,N,N^FD', edit1.text, '^FS')); memo2.Lines.Add('^XZ'); zpl.AddStrings (memo2.lines);...

Edit and onEnter event

delphi,delphi-7
I have problem with several things: How to make edit1.text be blank when i hit enter (i think it should be on onEnter event but not so sure) Is there any way to assign strings from Edit1.text to array? With all that said all i wanna do is: Enter a...

Remove specific XML element in Delphi

xml,delphi,delphi-7
I have an xml document looks like this: <?xml version="1.0"?> <Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ExtensionData /> <Name>ali</Name> <Age>37</Age> <Father> <ExtensionData /> <Name>I</Name> <Age>72</Age> </Father> <Mother> <ExtensionData /> <Name>M</Name> <Age>62</Age> </Mother> </Person> I am using Delphi 7. How can I remove all...

Custom component Convertion from delphi 5 to delphi 7

delphi,delphi-7,delphi-5
Recently I got a chance to convert delphi-5 code to delphi-7. At first I started converting Custom components to delphi-7. While compiling delphi-5 components in delphi-7 system is throwing error stating "Undeclared identifier: IFormDesigner". After googling I came to know IFormDesigner should be replaced with IDesigner. So after replacing IFormDesigner...

Delphi, search in text file

delphi,delphi-7
So, I have edit1 and edit2 + button on the form when I put some number to edit1, after on button_clik it will search 12345 in the specified text file, if found, read string after delimiter or all line and pu it to edit2. the code: procedure TForm1.Button1Click(Sender: TObject); var...

Calculated fields in table

database,delphi,delphi-7,calculated-field
I'm trying to create a calculated field (Cost) in a database table for values entered by the user for example price and quantity like in the example below : Cost = Price * Quantity I searched but I couldn't find a clear way how to it....

Why Application.OnException never runs?

delphi,exception-handling,delphi-xe2,delphi-7
Problem summary: The method assigned to Application.OnException never runs when an unhandled exception occurs. I create a blank project with only this unit and place a single button on Unit.dfm (this is based on an official example) : // Unit1.pas // ********* type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender:...

Change color of DBGrid row

delphi,delphi-7,tdbgrid
how change latest rec color dbgrid? if (Sender as TDBGrid).DataSource.DataSet.RecNo = (Sender as TDBGrid) .DataSource.DataSet.RecordCount then begin Canvas.Brush.Color := $00C66F71; end; (Sender as TDBGrid).DefaultDrawColumnCell(Rect, DataCol, Column, State); ...

FormClose how can make my App Extract this Folder Auto

delphi,delphi-7
need my App when the Form Close It Create this Folder Auto and every time this form open and close it's update the files Auto. +'Userinfo\'+BuddyName+'Archive\'+BuddyName+'); Procedure TPMWindow.FormClose(Sender: TObject; var Action: TCloseAction); Begin button1.click; memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'Userinfo\'+BuddyName+'Archive\'+BuddyName+''+BuddyName+'.html'); ...

How to calculate cash flow using calc fields?

delphi,delphi-7,firebird,firebird2.5,running-total
I'm programming a simple cash flow app, using Delphi 7, firebird 2.5 with InterBase components. The table in question was created like this: create table movimentos ( id d_inteiro not null, date_start d_data not null, date_end d_data, value d_valor, user d_inteiro, tipo_movimento d_inteiro not null, -- Indicates if it is...

ClassInfo function in Delphi 7

delphi,delphi-7,rtti
When I define a class like this in Delphi 7: TPerson = class(TObject) private FLName: string; FFName: string; FAge: integer; FBDate: TDate; public published property FName: string read FFName write FFName; property LName: string read FLName write FLName; property Age: integer read FAge write FAge; property BDate: TDate read FBDate...

How many counts the square number? [closed]

math,delphi-7
For example I have a number is 55. Can I check this for how many counts number's square create this number. For example I have 55 So, I know this number total from 5 number, which are 55 = 1^2+ 2^2+ 3^2+ 4^2 + 5^2(totally 5* number) I found the...

How to dock opened windows in Delphi 7 IDE?

delphi,delphi-7
How to dock opened windows in Delphi 7 IDE? The IDE opens with the top toolbar only and the rest of the screen showing the app behind the IDE. I have two monitors and the windows can float on top of any other window and if I have two instances...

Delphi - logging in to webpage from code

html,delphi,post,delphi-7,indy
I am using Delphi 7 and require some help with a problem, and yes, I have searched everywhere for an answer, yet the supplied code isn't documented , so I have no idea how it works or how to adjust it to fit my needs. What I am trying to...