Delphi Pages Forums  

Go Back   Delphi Pages Forums > Search Forums

Lost Password?

Showing results 1 to 50 of 191
Search took 0.12 seconds.
Search: Posts Made By: rojam
Forum: General 09-30-2018, 11:11 PM
Replies: 1
Views: 5,869
Posted By rojam
Rather than basing the flow of your code to an...

Rather than basing the flow of your code to an exception, you can get a reference to MS Word via code that doesn't cause and exception:

type
TForm1 = class(TForm)
Button1: TButton;
...
Forum: General 09-19-2018, 12:50 PM
Replies: 2
Views: 6,041
Posted By rojam
If DB Components are attached to the same...

If DB Components are attached to the same datasource/(query-table), then yes, it will act this way. How else would you expect them to act???
Forum: General 09-06-2018, 11:32 PM
Replies: 4
Views: 4,944
Posted By rojam
You need to include the original code for us to...

You need to include the original code for us to try to figure it out. The revised code could help also.
Forum: General 08-31-2018, 12:43 PM
Replies: 5
Views: 6,590
Posted By rojam
If you are connecting to a remote database, I...

If you are connecting to a remote database, I wouldn't keep an active connection to the database. Do the connection, run the operation (query, update, insert) and disconnect.

If you still want to...
Forum: General 08-21-2018, 12:39 AM
Replies: 4
Views: 3,967
Posted By rojam
Since you don't keep a reference to the...

Since you don't keep a reference to the resoucestream in your shortened approach, there's no way to free it.
Forum: General 08-20-2018, 05:36 PM
Replies: 4
Views: 3,967
Posted By rojam
I suppose you can use "Smart Pointers" to create...

I suppose you can use "Smart Pointers" to create an Interface. That way, when the Interface goes out of reference, it is automatically garbage collected. You can look an an implementation of a...
Forum: DB-Aware 08-14-2018, 03:49 PM
Replies: 1
Views: 4,850
Posted By rojam
What directory does your database sit on? Do you...

What directory does your database sit on? Do you have WRITE access to that directory?
Forum: General 08-09-2018, 12:43 PM
Replies: 2
Views: 2,126
Posted By rojam
Here...

Here (https://en.wikibooks.org/wiki/Algorithm_Implementation/Checksums/Verhoeff_Algorithm#Pascal/Delphi) is an implementation of the verhoeff algorithm in Delphi.

You could call this function from...
Forum: General 07-12-2018, 12:50 PM
Replies: 8
Views: 1,797
Posted By rojam
The code you have above will fail miserably if...

The code you have above will fail miserably if you have a multi-user database (such as MySQL, Oracle, MSSQL, Postgres). Even if it's not currently designed as a multi-user interface, you would have...
Forum: VCL 07-02-2018, 08:11 PM
Replies: 4
Views: 1,621
Posted By rojam
the split code would be something like this...

the split code would be something like this (untested)

procedure TForm1.SplitFile(const TheFile: String);
var
maxSplitPart: Integer;
InFS: TFileStream;
OutFS: TFileStream;
I: Integer;...
Forum: VCL 07-02-2018, 01:16 AM
Replies: 4
Views: 1,621
Posted By rojam
I believe that D7 can handle files that large...

I believe that D7 can handle files that large using TFileStream. To ensure, Check the definition of a TFileStream property such as Position and ensure it is defined as an Int64. (I don't have D7...
Forum: General 06-12-2018, 05:09 PM
Replies: 6
Views: 1,432
Posted By rojam
try implementing a log in page as detailed here. ...

try implementing a log in page as detailed here.

https://www.thoughtco.com/display-a-login-password-dialog-1058469
Forum: VCL 06-11-2018, 07:13 PM
Replies: 2
Views: 1,463
Posted By rojam
I believe the first issue can be fixed by...

I believe the first issue can be fixed by changing

ItmIndx := lstProdOD.items[lstProdOD.ItemIndex]; //you are always selecting the SAME item, ItemIndex returns the index of the selected row
to
...
Forum: General 05-04-2018, 03:24 PM
Replies: 1
Views: 994
Posted By rojam
I assume you actually mean overload, not...

I assume you actually mean overload, not override. Overload allows two (or more) functions/procedures to have the same name but having different signatures (parameter list). A DLL exports its...
Forum: General 04-26-2018, 01:03 PM
Replies: 11
Views: 1,509
Posted By rojam
try running the command "GetCurrentDir" somewhere...

try running the command "GetCurrentDir" somewhere within the code you posted above and see if the returned value is the same as the directory you are attempting to delete. If so, that may be why you...
Forum: General 04-15-2018, 01:40 AM
Replies: 2
Views: 1,127
Posted By rojam
Drop a TApplicationEvents on your form, and...

Drop a TApplicationEvents on your form, and select the OnDeactivate Event to know when the application loses focus.
Forum: General 04-15-2018, 01:36 AM
Replies: 2
Views: 891
Posted By rojam
simply use the DBGrid's OnMouseUp (don't use...

simply use the DBGrid's OnMouseUp (don't use OnMouseDown) to check if the X value of the Mouse Click is within the gutter of the DBGrid.


procedure TForm1.DBGrid1MouseUp(Sender: TObject; Button:...
Forum: General 01-31-2018, 04:00 PM
Replies: 6
Views: 1,624
Posted By rojam
You can't use parameters in the SELECT portion of...

You can't use parameters in the SELECT portion of a query. You'll have to concatenate that portion of the query, then you can use parameters for the WHERE portion of the query.

V1 := 'SELECT...
Forum: General 11-13-2017, 08:19 PM
Replies: 2
Views: 2,227
Posted By rojam
what you need is StringToColor...

what you need is StringToColor (http://docwiki.embarcadero.com/Libraries/XE3/en/Vcl.Graphics.StringToColor)
There's also ColorToString...
Forum: General 11-02-2017, 08:03 PM
Replies: 6
Views: 3,413
Posted By rojam
No wonder you are losing the font data. All you...

No wonder you are losing the font data. All you are doing is saving RichEdit1.Text to your database. RichEdit1.Text only contains the text contained within the RichEdit1, none of the formatting.
...
Forum: General 11-01-2017, 02:33 PM
Replies: 8
Views: 2,988
Posted By rojam
OpenDialog has an overloaded method, not sure it...

OpenDialog has an overloaded method, not sure it is included in Delphi5, but you can give it a try.

call OpenDialog1.Execute with the Handle of the form you want to stay up front.

if...
Forum: General 10-31-2017, 07:10 PM
Replies: 8
Views: 2,988
Posted By rojam
Can you please explain again what the problem is...

Can you please explain again what the problem is and what you are attempting to do. At best, it seems you are attempting to execute OpenDialog1, so what issue are you having?

Also, the code you...
Forum: General 10-30-2017, 07:47 PM
Replies: 5
Views: 2,381
Posted By rojam
Try this function TForm1.FindLastSlash(const...

Try this

function TForm1.FindLastSlash(const Value: String): Integer;
var
I: Integer;
begin
Result := -1;
I := Length(Value);
While I > 0 do
begin
Forum: General 10-26-2017, 02:37 PM
Replies: 3
Views: 1,884
Posted By rojam
Can you give us the structure of your tables, the...

Can you give us the structure of your tables, the database (I'm assuming you mean database when you mention table) and which components you are using to connect to them? Also which version of Delphi...
Forum: General 10-24-2017, 02:10 PM
Replies: 4
Views: 2,181
Posted By rojam
You didn't mention which database you are using,...

You didn't mention which database you are using, but you can read here (https://dev.mysql.com/doc/refman/5.7/en/fixed-point-types.html) why what you did wouldn't work with MySQL.

From that page:
Forum: General 10-05-2017, 02:37 PM
Replies: 2
Views: 1,709
Posted By rojam
I haven't tested this code, but the basic premise...

I haven't tested this code, but the basic premise is to use a regular expression to match the domain and to add it to another StringList, returning the StringList with the matched values. Make sure...
Forum: General 09-12-2017, 04:09 PM
Replies: 3
Views: 2,559
Posted By rojam
You really need to rethink your logic, this time...

You really need to rethink your logic, this time remembering you are attempting to have a multi-threaded process.

In procedure ThreadEmail.Execute, you set up IdSMTP, Pool, SSHandler, the push...
Forum: General 09-11-2017, 04:19 PM
Replies: 3
Views: 2,559
Posted By rojam
What happens if you change the execute method to...

What happens if you change the execute method to FIRST check to see if the thread is terminated and only create the INDY components if there's an item in the Queue:


procedure...
Forum: General 08-25-2017, 07:57 PM
Replies: 4
Views: 2,813
Posted By rojam
What you are looking for is a global keyboard...

What you are looking for is a global keyboard hook and you would have to implement that in a DLL and call the DLL from your application. Just google

global keyboard hook example

and there are...
Forum: General 08-07-2017, 07:22 PM
Replies: 2
Views: 3,974
Posted By rojam
Don't use a FDTable, use a query component...

Don't use a FDTable, use a query component instead and select the substring of gms_verb.

substr(gms_verb, 1, <#of char to return>)

set the sql property of the query to something like:

select...
Forum: General 06-07-2017, 02:44 PM
Replies: 19
Views: 6,805
Posted By rojam
Not sure which version of Delphi you're using,...

Not sure which version of Delphi you're using, but if you have XE2 or better, are you sure you have the correct dlls. If you are compiling for x64, then you need the x64 version of the dlls, or x86...
Forum: General 06-05-2017, 04:04 PM
Replies: 3
Views: 5,041
Posted By rojam
How to you intend to implement something like...

How to you intend to implement something like this? You have an INFINITE number of idle moments within your application (not quite infinite but you get the idea), do you intend to launch an...
Forum: General 05-26-2017, 04:05 PM
Replies: 19
Views: 6,805
Posted By rojam
Google restricts access to email from less secure...

Google restricts access to email from less secure apps. Most likely your application is considered by Google as a less secure app. There's a google e-mail setting your software users will need to...
Forum: General 04-10-2017, 03:12 PM
Replies: 3
[SOLVED] DOS Output
Views: 2,879
Posted By rojam
Which version of GetDOSOutput are you using? The...

Which version of GetDOSOutput are you using? The one found here (http://delphidabbler.com/tips/61)? If you want to update the memo as output is received, you'll need to convert this FUNCTION to a...
Forum: General 02-27-2017, 02:07 PM
Replies: 5
Views: 2,955
Posted By rojam
Your function is flawed. A function MUST...

Your function is flawed.

A function MUST return a value.

1) if '(FldDest.DataType=ftBoolean)' evaluates FALSE, then your function never sets Bool thus FldDest.AsBoolean:=Bool; is...
Forum: VCL 02-19-2017, 08:10 PM
Replies: 4
Views: 2,368
Posted By rojam
What I provided does not in any way stop you from...

What I provided does not in any way stop you from saving the changes to a file like you were before.

All I pointed out was that you didn't need to save it to file and then reload from the file.
Forum: VCL 02-17-2017, 01:55 PM
Replies: 4
Views: 2,368
Posted By rojam
You don't have to save the Memo to file to allow...

You don't have to save the Memo to file to allow the combobox to update it's contents.


ComboBox1.Items.Assign(Memo1.Lines);


ComboBox1.Items and Memo1.Lines are both TStrings so you can...
Forum: General 02-06-2017, 02:58 PM
Replies: 2
Views: 1,975
Posted By rojam
Have you tried to replace TMemoryStream with...

Have you tried to replace TMemoryStream with TFileStream? You can create the FileStreams in the Temp directory.
Forum: General 02-01-2017, 08:14 PM
Replies: 7
Views: 1,944
Posted By rojam
Yes it can handle these features - but so can...

Yes it can handle these features - but so can RichEdit...


TRichView can save the file to rtf, and it also can save the file as a rvf format that TRichView defines. As to exporting to PDF, they...
Forum: General 02-01-2017, 01:52 PM
Replies: 7
Views: 1,944
Posted By rojam
I agree with Norrit, but I have TRichview and if...

I agree with Norrit, but I have TRichview and if you have questions about whether it handles something particular, I may be able to tell you, and I can tell you that the tool is definitely maintained...
Forum: General 01-13-2017, 04:18 PM
Replies: 7
Views: 2,895
Posted By rojam
That is because you are just subtracting one time...

That is because you are just subtracting one time from another and displaying the result as a TTime variable itself.
Try something like

uses ..., DateUtils;

...

var
m: Int64;
...
Forum: General 01-13-2017, 03:23 PM
Replies: 7
Views: 2,895
Posted By rojam
You do realize that both times would probably...

You do realize that both times would probably NEVER be EQUAL. A TTime variable keeps the time down to the millisecond, so if the application doesn't request the time at exactly the correct...
Forum: General 01-12-2017, 09:05 PM
Replies: 7
Views: 2,895
Posted By rojam
Sorry, but it is very difficult to understand...

Sorry, but it is very difficult to understand your statement.

Please try to better explain what

"and time left 2 minutes to take 11:00:00 of system time"

means.

does 11:00:00 mean...
Forum: General 01-12-2017, 08:55 PM
Replies: 1
Views: 1,645
Posted By rojam
Does your INSERT have a generated primary ID, and...

Does your INSERT have a generated primary ID, and if so, how does it get it? Depending on how your code is handling getting the next value, it may try to insert a subsequent record with a...
Forum: General 01-06-2017, 12:17 PM
Replies: 6
Views: 5,447
Posted By rojam
Then try to code what @Marsheng provided. If you...

Then try to code what @Marsheng provided. If you get stuck, then ask.
Forum: General 01-06-2017, 01:06 AM
Replies: 6
Views: 5,447
Posted By rojam
The following capitalizes the first character you...

The following capitalizes the first character you type in the memo, any character you type after the enter key or after a period/exclamation point or question mark.

type
TForm1 = class(TForm)
...
Forum: General 01-02-2017, 06:25 AM
Replies: 6
[SOLVED] PNG to BMP
Views: 4,066
Posted By rojam
D7 could not work with PNG images natively, but...

D7 could not work with PNG images natively, but you can download PNGImage (TPNGObject) from here...
Forum: DB Tools 12-28-2016, 04:10 AM
Replies: 4
Views: 2,757
Posted By rojam
try this InvData.Filter := 'DEPART = ' +...

try this

InvData.Filter := 'DEPART = ' + QuotedStr(DepartmentListBox.Text) + ' AND NEXTCAL <= ' + QuotedStr(DateToStr(NextDate));
Forum: DB Tools 12-27-2016, 08:05 PM
Replies: 4
Views: 2,757
Posted By rojam
procedure...

procedure TForm1.ClientDataSet1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
//do not open and close the cds within the FilterRecord method, ONLY set Accept...
Accept :=...
Forum: General 12-24-2016, 02:46 AM
Replies: 1
Views: 2,485
Posted By rojam
it's a bug. You can usually fix it with...

it's a bug. You can usually fix it with increasing then decreasing the width of the dbgrid by 1 at every event that causes them to disappear.

DBGrid1.Width := DBGrid1.Width + 1;
DBGrid1.Width :=...
Showing results 1 to 50 of 191

 
Forum Jump

All times are GMT. The time now is 08:42 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.