Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Delphi And Pascal

Delphi And Pascal

1-20 of 261     Previous     Next
Passing Strings Between Delphi DLL and VBA
by Romeo Besas
Unlike other routines, this one doesn't need to pass the length of the returned string for later Trimming in VBA.
A Simple Right Mouse Click
by DevX Pro
I am learning Delphi 4. I'm trying to create a program that can distinguish between a right and left mouse click and perform an operation based on which button has been pressed. The tutorial I'm reading uses the TMouseButton parameter inside the procedure. It looks like this: procedure LineForm.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); But this doesn't distinguish between left and right buttons. How do I make this happen?
Displaying a Record Number for a Table
by DevX Pro
I use an InterBase database with an alias made in BDE. I want to display the record number for a table when I navigate through the records. Your solution >.RecNo always returns –1 because it is a TDataSet.RecNo. Is there another solution?
Program Fails to Compile
by DevX Pro
Every time I try to compile a program, I get "Error(0) Duplicate Resources" and the program stops. I understand that this is a linker error of some kind, but I don't know what. Can you help? (I am using Delphi 3 Standard Edition.)
Select Stored Procedures in MS SQL 7
by DevX Pro
How do I access an MS SQL 7 Stored Procedure that returns a multi-row Dataset through Delphi 3? InterBase allows selecting from a Stored Procedure. MS SQL 7 only allows selects from tables, views, or from a "Rowset Function," but not from a Stored Procedure.
BDE Engine Error When Installing Delphi 3
by DevX Pro
I used InstallShield that comes with Delphi 3 to install a Delphi 3 program on another user's computer running Windows 98. The install includes the full BDE and two Paradox tables. When I try to run the program, I get an EDB Engine Error saying unknown database alias: DEFAULTDD. What could be causing this problem? Why would the installation work on one computer, but not another?
Changing Label Captions in a FOR Loop (Follow-up)
by DevX Pro
In your answer to my previously posted topic, "Changing label captions in FOR loop," you suggested I use "Sleep." When I used it, the loop slowed down but didn't display anything on my form. It looks like the number i increases by one and sleeps for 200 milliseconds again and again until i:= 1000 then the label.caption changes to i:= 1000. What's wrong?
Convert Delphi to C++?
by DevX Pro
How can you convert Delphi to C++?
Create an Invoice
by DevX Pro
I need to create an onscreen invoice. I can figure out Supplier name, Customer name, and so on. But I can't figure out how to do the body—for example, the line items. I tried using TLabel and TEdits but it looks like an ugly patchwork quilt.
Cumulative Summary in SQL
by DevX Pro
I need a summary-select which summaries cumulative values. This one works in Microsoft Access: SELECT s.nl_item_id, s.nl_value, ( SELECT sum(sub.nl_value) FROM TABLE1 sub WHERE sub.nl_item_id How can I make it work using a BDE-DB2 alias?
Determine Which Controls are on a Form
by DevX Pro
Is there a simple way to ascertain the names of all the controls on a particular form at run time?
Paradox Lock Files
by DevX Pro
I have a Delphi 3 application running on a Novell network, that uses Paradox tables. For some reason, some of the users get the following message every once in a while: File or directory not found: J:\APPS\HOMECARE\PARADOX.LCK J:\APPS\HOMECARE\PDOXUSR.LCK Nothing I do seems to make a difference. I have made sure that every user has the same BDE version (5.0), and I have removed all the old IDAPI files and references. I have set the NET DIR parameter to a directory other than where the tables are, and made sure all users point to the same net directory. I have also moved the executable into a different directory. What is going on?
Put a Variable in a SQL String
by DevX Pro
How can I put a variable in a SQL string? For example: input:=edit1.text; query1.sql.add('select * from address where name like ');
Speed Up Run Time
by DevX Pro
My executable takes almost a minute to run. How can I speed up the process? I am not running any queries at this point—I wait until I actually show the forms. All I do on start up is create my forms (approximately 10) and quick reports (approximately 10). Is there a more efficient way of loading my forms and reports? I tried to create them as I used them but ran into a lot of access violations.
String to Float
by DevX Pro
How do I add two label values together and submit the answer to another label? Label19.Caption := FloatToStrF(Table1Standard.AsFloat,ffCurrency,15,2) Label20.Caption := FloatToStrF(Table1Zero.AsFloat,ffCurrency,15,2) Label21.Caption := StrToFloat(?????????
Typecast Text to LPARAM
by DevX Pro
How do I typecast text to LPARAM? LPARAM is supposed to be an integer, but clearly the API call wants text. I'm assuming I missed some pchar>string or pointer stuff, but haven't been able to figure out what exactly I am missing. Here is my code: MyMSG1: TMSG; Stringtofind: pchar; begin Stringtofind:='I am a string!'; with mymsg1 do begin message:=lb_findstring; wparam:=-1; lparam:=stringtofind;
Undeleting Records from Paradox Tables
by DevX Pro
How can I undelete a record from a Paradox table?
Activate Popup Hints
by DevX Pro
I want to activate those small popup windows (the ones that appear when you hold your mouse over a program icon in the Taskbar to tell you what appears in your title bar) on parts of my applications. I'd like to do it in the Taskbar as well as with buttons in my program. I am using Delphi 2.
Adding Resources to an EXE
by DevX Pro
How can I add resources to an EXE or DLL? I am using Delphi 3 at the moment. For example, I want to use a new Cursor (a self created 32x32 bitmap), but I need to add it first to the resources of the application before I can use the LoadCursor command. All of the examples show you how to read existing resources and not how to add resources. Also, how can I use a bitmap safely in an application without sending the bitmap with the application (Using LoadFromFile)? I want to make it impossible to change the bitmap after the application is compiled.
Problem Closing Forms
by DevX Pro
I created the main search screen form SearchScrn (fsNormal) with the ability to create as many new forms on the fly (they are not children of MDI form) as possible after a search is refined. I can close all of these forms using one button click event: procedure TSearchScrn.CloseAllBtnClick(Sender: TObject); begin SearchScrn.Close; end; { TSearchScrn.CloseAllBtnClick } This works, but if I want to start new search, I try to close all forms and create a new main SearchScrn form: procedure TSearchScrn.SearchListBtnClick(Sender: TObject); var SearchStr1 : String[20]; SearchOp : String[ 3]; SearchStr2 : String[20]; begin if Pos('New',SearchListBtn.Caption)>0 then begin SearchStr1:=SearchFld.AsString; SearchOp :=SearchOperator.Text; SearchStr2:=SearchFld2.AsString; SearchScrn.Close; SearchScrn := TSearchScrn.Create( Self ); with SearchScrn do begin SearchFld.AsString:=SearchStr1; SearchOperator.Text:=SearchOp; SearchFld2.AsString:=SearchStr2; MakeSearch; ShowModal; end; end else MakeSearch; end; { TSearchScrn.SearchBtnClick } For some reason SearchScrn.Close does not close all the forms and instead leaves them on the screen.
1-20 of 261     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date