Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Delphi And Pascal

Delphi And Pascal - Page 2

21-40 of 261     Previous     Next
Set a Counter Field
by DevX Pro
Is there an easy way to increase certain fields in tables working as a counter from a third table in a master/detail form? For example: Order Table Item Table Counter Table Order ID Order ID Count
Converting a String Character to its ASCII Value
by DevX Pro
How do I read the last character in a DBEdit box and get its ASCII value? The character will change, depending on the DBEdit.Text property.
Executing a File Selected in Filelistbox
by DevX Pro
I am trying to work out the coding to execute a file that I select in my filelistbox in Delphi 4. Can you help me?
Shared Database Session
by DevX Pro
Is there a way to share a database session between calling application and DLL? Not having such a sharing (DLL with DataSet components) increases the number of SQL server clients.
Transfer Data to a Temporary Table With a Scope
by DevX Pro
I work with a Paradox and a MSQL database and I need to transfer data from the Paradox to a temporary table with a scope (create table #Table_name). I tried to use a batch move, but the table component didn't find the temporary table. It only finds it if I use a temporary table with a global scope (create table ##table_name). I tried this query: ( INSERT INTO ":MSQL:#table_name" (atributes) SELECT atributes FROM (paradox_tables) ) However, the same problem occurred as did with the table component; it only accepted it with a global scope(##). The only way I got the transfer to work is with two queries. In the first query, I used a select, and after I used an insert line by line with the result of the select. However, the performance is four times slower than the insert select in one query.
Trying to Modify an Original Program
by DevX Pro
I commissioned a program that was written in Delphi. I am not a programmer, but an excellent hacker. Is there any way I can get into this program to edit text and not functions? The program does what I want, but I need to do some text edits.
Descendants of TTreeNode Not Compatible
by DevX Pro
I am having troubles with the TTreeView component and adding custom derivations of TTreeNodes to it. I want to define a new type of TTreeNode with a lot of extra parameters for my application (for example, an internal-timer for each item that does some polling, and so on) and then add that new node to a TTreeView. The problem is caused by this simplified subclass that I created of TTreeNode: ========== TUser Class ======================== type TUser = Class( TTreeNode ) private FSomeTimer : TTimer; FUserTag : String[10]; public constructor Create( AOwner: TTreeNodes ); virtual; destructor Destroy; override; //procedure SetTag( s : String ); not relevant in example end; { procedures follow } constructor TUser.Create( AOwner : TTreeNodes ); begin inherited Create( AOwner ); FSomeTimer := TTimer.Create( nil ); FSomeTimer.Enabled := FALSE; end; destructor TUser.Destroy; begin inherited Destroy; FSomeTimer.Free; end; ====================END TUser Class ================ When I try this next code, I receive a compiler event saying that it is not assignment compatible, which is understandable as it really isn't: var aUser : TUser; begin aUser := TreeView1.Items.Add( nil, 'some caption'); end; Also, if I were to type cast the result from the .Add, it would compile but crash at run time if I attempt to modify any of my "extended" properties. However, when I try this line of code, it does compile and work, but the item does not actually show up on screen: aUser := TUser.Create( TreeView1.Items ); How can I solve this problem? Do I need to create some new type of TTreeView? If so, how is this possible?
Different Versions of Delphi and the BDE
by DevX Pro
Is it possible to have two different versions of the Borland Database Engine (BDE) installed on the same machine? I've been developing in Delphi 3, recently went to Delphi 4, and discovered that the native MSAccess driver that came with BDE 5.01 is way too slow. I'd like to be able to develop my Delphi-Access applications in Delphi 3, and use the old BDE 4.51 for speed, but use Delphi 4 for everything else. How would I set this up?
Load a Text File Into a Memo
by DevX Pro
How do I read a file on the A:\ drive into my program and then display the contents into an edit box?
Open Database Error
by DevX Pro
I am updating an application that was developed to make an executable test version. However, the live database is opened, not a test database. I have made a test database for this purpose. When I run my new executable and it is loading the live database I get the error: "Cannot perform this operation on an open database." I click OK and my application runs. I am not sure how to get rid of this error. It does not appear in the executable written by the previous programmer even though it was tested using the live database, and never using a test database. What generates this error and is there anyway for me to get rid of it?
Refreshing the Desktop
by DevX Pro
How do I refresh the desktop after I draw on it?
Type-Declaration Characters
by DevX Pro
I'm having problems passing variables to an API function. I always receive a Type mismatch error. I reproduced the situation in Visual Basic and found that if I used type-declaration characters to declare the problem variables, they were compatible with the API function. So now, I have it working in Visual Basic, but not yet in Delphi. Are there type-declaration characters or something equivalent in Delphi? Here is a sample of my VB code: 'The following vars must be declared with a 'type-declaration character, 'else Type mismatch '(why?...I have a hunch that using 'As String' 'assigns a NULL value, where 'var$' actually 'assigns an empty string "") Dim desc$, dt$, con$, fn$, own$, v6$ 'strings Dim fo%, mt% 'integers
Database Reporting
by DevX Pro
What is the best way to do a database report—in other words print a database? I have been having serious trouble with QuickRep. I specify the dataset but still can't get it to print. I need help!
Delphi MDI Form
by DevX Pro
Imagine an MDI application where the MDIFrame has many MDIChild forms—each one derived from TBlueForm class. The TBlueForm class has a public method named ChangeColor which only makes the form's color change from gray to blue. How do I call the ChangeColor method from the MDIFrame without referencing the Childform's name but using the ActiveMDIChild property of the MDIFrame? ActiveMDIChild.ChangeColor; When I tried this, the compiler returned the error: Undeclared identifier:'ChangeColor' So it seems that ActiveMDIChild only recognizes the methods inherited of TForm. All the MDIChild forms were included in the uses session of the MDIFrame.
Displaying Changes to a Record
by DevX Pro
I have set up a paradox table for multiple user access using the Netdir method, but when I post a record other users cannot see the changes until the table is refreshed. Is there any way to avoid this?
Resources for Delphi 32-bit Programming
by DevX Pro
Can you recommend resources to learn how to tackle 16-bit and 32-bit programming in Delphi?
Saving New Database at Run Time to a New File
by DevX Pro
How do I save my new database at run time to a new file? I'm using a paradox database—DBGrid, and a table and data source control.
Running Applications From Your Own
by DevX Pro
What code do I use for Delphi to run a program and use command line parameters inputted by the user?
Determining Shift Button State
by DevX Pro
How can I determine if is down or up while dragging an object within my app? The goal is to detect if something is being copied or moved.
Using GetFileTime and CompareFileTime
by DevX Pro
Could you please explain, along with examples, how to use the commands GetFileTime and CompareFileTime? I read the help topics but find it hard to digest what they say. I want to compare two files' last modified date. I haven't really used file in Delphi before but I've used it in standard Pascal. Any help would be appreciated.
21-40 of 261     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date