Pascal

Pascal is an influential imperative and procedural programming language, largely (but not exclusively) intended to teach students structured programming and data structuring. Pasca was implemented on a wide range of architectures, from early PCs to mainframes. Pascal derivatives include OOP-based Object Pascal (used in Delphi and Lazarus/Free Pascal). Pascal is a purely procedural language and includes control statements with reserved words, but has many data structuring facilities and other abstractions like type definitions, records, pointers, enumerations, and sets.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi Experts,

   I need develop software with Artificial inteligence to decision, i have a component with Neural Network with multi-layer, but algorithm Adaline is more applied to this. How can i develop Neural Network Adaline algorithm with Delphi or component with this to download?

Thank very much
0
Hy

I Created a component derivated from TClientDataSet.

I'm having trouble to override the refresh event.
I need to "kill" the active event, and make I new one.

So, when the user is on the DBNavigator, and triggers the "Refresh" option, it should call the new method.

Here is the code for the component that I have today.
Could you help me to achieve this result?

Thanks.

unit ERPDataSet;

interface

uses
  System.SysUtils, System.Classes, Data.DB, Datasnap.DBClient;

type
  TERPDataSet = class(TClientDataSet)
  private
    { Private declarations }
    FNomeTabela: string;
    FChavePrimaria: string;
    FComandoSQL:string;
  protected
    { Protected declarations }
  public
    { Public declarations }
    procedure IncluiChavePrimaria;
  published
    { Published declarations }
    property ChavePrimaria:string read FChavePrimaria write FChavePrimaria;
    property ComandoSQL:string read FComandoSQL write FComandoSQL;
    property NomeTabela:string read FNomeTabela write FNomeTabela;
  end;

procedure Register;

implementation

//=================================================================================================================================================================================
procedure Register;
begin
  RegisterComponents('Rafael', [TERPDataSet]);
end;

{ TERPDataSet }

Open in new window

0
I have an application that I develop for my company, that is basically our main business system, including ERP/MRP/CRM, etc.

Recently, I've migrated my development environment to Delphi XE2 (I still develop on a Win XP computer).  I use the PDAC VCL component library to connect to a Pervasive Server Engine, via the installed Client Engine on each computer.

Do to the amount of errors that my program is getting, and because I have had no luck in "capturing" and handling the errors with exception handling, I decided to try "MadExcept" within my Delphi project.  I love the ability of MadExcept to capture any and all errors and submit "bug reports" to me directly via email.  However, I am having a difficult time isolating exactly what is causing the errors, even with the bug reports.  I guess I need to go back to school, so that I can read assembler code, or something, but I was hoping by posting one of these "bug reports" someone could give me a clue, to help figure out what is causing the issues.  I do know that the issues are sometimes related to Rave reports, and  I do not intend to just re-write the reports, as that would be quite an undertaking.  Rave is available for XE4, Embarcadero's latest release, so I feel comfortable keeping Rave for my reports.

I'm attaching a file to this post, for review of a couple of bug reports.  Please tell me if any of you can decipher these and help me on my way to debugging my application.

TIA,
Brent
bugreport.txt
0
Hy

I need some help for creating a custom component, derivated from TcxDBLookupComboBox, that allows AccentInsensitiveSearch.

This component already has the property TcxDBLookupComboBox.Properties.CaseSensitiveSearch.
When this property is false, it allows to press the letters of a word, and it finds the corresponding word, even if the list source is with capital letter or not.

But in Brazil, we have accents, and I'm obligated to press the letters with the right accentuation.
I didn't wanted to obligate the user to do that.
Today, if I don't press the right letter(with accent), it won't find the corresponding entry on the list source.

Could you help me on creating this property or another way to reach this behaviour?

Example: The word HAT, in portuguese is CHAPÉU.
If you make a sample that only works with this letter, I can adapt it to the other letters.

Thanks.
0
Hy

I need a way to create a pool, where only the last procedure called must be executed.

I'll explain: Think of a datasource the has a lot of records.
Every record is connected to other child datasources.
Everytime i move to another record, I need to do an HTTP.get (by TIdHttp) from a webservice.

The thing is that it takes a time to retrieve all records.

When the user is moving throug lots of records, my program gets busy, because it  executs all procedures called.

But If the user goes to a second record, and in 300ms, the user changes to other record, I must abort the current process, and leave only the last call running.

If I get this, my program will have a much faster user experience, beause the user won't need to wait for all operations to get concluded.

I made a sample application, to illustrate my question.

It has a dbgrid with records, and a progress bar.
Everytime a move to a new record, it loads the progress bar from 0 to 100, in 10 seconds.

In this time, if I move through 10 diferent records (during, lets say, 3 seconds), it will take 100 seconds to do all the tasks.
But only the last call is important to be executed.

Making this to operate in separeded threads. wont help, because I don't need the data from the other calls. Only from the last one.

Could you give me a tip to accomplish that?

Thank you.
SampleApp.zip
0
Hello Experts,

In earlier Delphi versions I had a nifty way of formatting long lines of text into word wrapped lines of text of a specific width. I did this by using a TMemo component and setting it to the desired width, for example:

AMemo.Width:=400;

Then I would dump the text into it using the Text property:

AMemo.Text:=ALongLineOfText;

Finally, via the Lines property, I was able to count and access the number of the individual, word wrapped lines. In other words, a “single” line of text 245 characters long for example, might really be three or four lines of text in the TMemo component depending on the width of the TMemo.

This doesn’t work in FireMonkey 3. The text that is assigned to the memo’s Text property is referenced by the Lines property only according to any carriage returns or line feeds it finds. The Lines property returns the lines and line count without regard to whether a particular long line of text is actually wrapping along more than one line in the TMemo component. In the above example, the three or four lines of text you see in the TMemo would be referenced in the Lines.Count property as 1 line instead of the three or four lines that it really is.

I haven’t been able to find a way around this and get the real line count and individual line contents. Does anyone know of a way?
0
Hello,

I have a interfaced object and a function like this:

function InvokeCommand(trackingID: Integer; const name: WideString;
                           const stringParam: WideString; datasetParam: OleVariant): HResult; stdcall;

I need to read values in datasetParam...

How can i do that?
0
Anyone have a solution for encrypting password in Delphi XE2?
0
Hi Experts,

   I receive access violation error when i call conn.close;

conn id as TSQLConnection with datasnap .

My code is:

if conn.Connected then
   begin
      conn.CloseDataSets;
      conn.Close;
   end;

but when call conn.close the error Access Violation is appear.

Can you help me?

Thanks
0
Hi Experts,

I need change DisplayName of my service on install, but i'm try change on OnBeforeInstall event and not works fine.

How can i change displayname of service dynamically

Thank a lot,
Felipe
0
Delphi XE, Looking for component (free, or value priced)
which will be able to record sound from sound system microphone and store into mp3,

Perfect solution would be option to detect level of signal strengh, I mean e.g. microphone recorder will stay all day turned on so not to take much too disk space, only start to record when detect some activity.

Thanks in advance
0
0 down vote favorite
	

I want to disable the gridlines in a drawgrid and draw the grid lines myself for every other columns. Row lines are not needed.

I want to merge two cells in the fixed area so that it looks like as it is one column, like in this picture:drawgrid how i want to look like
the attached code i have inserted to ondrawcell event of the dragrid

 procedure Tbookings3_Frm.bgridDrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
  CellIndex: Integer;
    s:string;
  x:integer;
begin
  CellIndex := (ARow * bgrid.ColCount) + ACol;

  if gdFixed in State then
  begin
    bgrid.Canvas.Brush.Color := clskyblue;
  end
  else if (State * [gdSelected, gdHotTrack]) <> [] then
  begin
    bgrid.Canvas.Brush.Color := clHighlight;
  end
  else
  begin
    bgrid.Canvas.Brush.Color := Cells[CellIndex].BkColor;
  end;



  bgrid.Canvas.FillRect(Rect);

  if gdFixed in State then
    Frame3D(bgrid.Canvas, Rect, clHighlight, clBtnShadow, 1);

  if gdFocused in State then
    bgrid.Canvas.DrawFocusRect(Rect);

//---------------

  with (Sender as TDrawGrid).Canvas do
  begin
     // set font
    Font.Color := CLblack;
    FillRect(Rect);

    if ARow = 2 then
    begin
        x := (Rect.Right - Rect.Left - TextWidth(days_h[ACol])) div 2;
        TextOut(Rect.Left + x, Rect.Top + 2, days_h[ACol]);
    end;
  if ARow = 1 then
     begin
       x := (Rect.Right - Rect.Left - TextWidth(sun_mon[ACol])) div 2;
       TextOut(Rect.Left + x, 

Open in new window

0
greetings,

I have a Delphi DLL that works when called by delphi apps and exports a method declared as:

Procedure ProduceOutput(request,inputs:widestring; var ResultString:widestring);stdcall;

On the C++ side I have tried:

[DllImport( "ArgumentLab.dll", CallingConvention = CallingConvention.StdCall, CharSet=CharSet.WideString )];
 extern void ProduceOutput(WideString request, WideString inputs, WideString ResultString);


WideString arequest = WideString(ComboBox1->Text);
WideString ainput = "<xml> Input Text Goes Here </XML>";
WideString  aresultstring;
WideString &aresultstringpointer = aresultstring;
aresultstring = " ";
ProduceOutput(arequest, ainput, &aresultstringpointer);

Memo1->Lines->Text = &aresultstringpointer;

My console error reads:

  Unit1.cpp(13): candidate function not viable: no known conversion from 'BSTR *' (aka 'wchar_t **') to 'System::WideString' for 3rd argument;

I have built the DLL and the c++ test app using Rad Studio XE4 - it is a 64 bit DLL and APP

How should I have gone about doing this?  

Best regards,

garry
0
I am having a problem with a Delphi 5 app, utilising first Indy 9, and then Indy 10.

Components in use (Indy 9):
TIdHTTP, TIdConnectionIntercept & TIdSSLIOHandlerSocket.
Components in use (Indy 10):
TIdHTTP, TIdConnectionIntercept & TIdSSLIOHanlderSocketOpenSSL.
(SSL is in use, with no TIdAntiFreeze in use)

The problem the app is presently experiencing is slow responses (between 3 and 25 seconds) to TIdHTTP POSTs.

Based on assorted links, I have tried:
- setting ConnectTimeout to zero
- setting the HTTPOptions flag hoKeepOriginalProtocol
- upgraded from 9 to 10 (10.5.8 XE2)

As a test, I also tried using a test executable written in C# (HttpWebRequest), which gets split-second response times.

Is there anything else I can try with Indy 9/10 config?
0
I include the Character unit in my uses clause, but get the warning, Symbol 'ToLower' is deprecated: 'Use TCharHelper'. I use ToLower to do a case conversion on unicode characters.

I can't work out how to include TCharHelper.
0
Hi,

Looking for the most professional and universal way to monitor history of visited web pages to all modern browsers, the best browser independent...
I don't need code writing exact, just avice on choose different method.
I would rather want to avoid sniffing packets....
I mean catch adress when website is entered and the same as it's clicked on link, so simple key log solutions will do not work there.

Please give me best option.
0
Greek Extended characters do not "stick" in Delphi MIDAS wide memo field.

I can enter them into a wide memo, but when the field is saved to the TClientDataSet and then read again, it comes back as "?"

I can work around this by writing the memo as a fixed length wide string (with a substitute new line character), but this loses the flexibility of the memo type, which allows many lines, entirely at the user discretion.

Here is the code used to save the field:

     cdsDiction.FieldByName('WideMeaning').Assign(Meaning.lines);

Where cdsDiction is a TClientDataSet and the associated data field "WideMeaning" is a Wide Memo, and the VCL field "Meaning" is a TMemo.
0
Hi

I have an own component where I add a property SaveOrder with a default value. If I add the component on design-time the SaveOrder is false instead of true:
  tTest = class(TDbGrid)
    private
      FSaveOrder : boolean;
    published
      property SaveOrder: boolean read FSaveOrder write FSaveOrder default true;
  end;

Open in new window


See my simple sample. What's wrong?
Thanks, Peter
0
Goal
Show All invoice records that belong to the matching Customer
Im stuck on some code.
procedure TForm1.lvCustomersItemClick(const Sender: TObject;
   const AItem: TListViewItem);
begin
   TabControl1.ActiveTab:= tiInvoice;
   InvoiceQuery.Active:= True;
   while not  InvoiceQuery.Eof do
  begin
    InvoiceQuery.SQL.Text:=('Select Customers.Name,Customers.ID,Invoice.CusID From Customers Inner Join Invoice On Invoice.CusID = Customers.ID Where Customers.ID = :lvcusDetail');
    InvoiceQuery.ParamByName('lvcusDetail').asinteger := strToInt(lvCustomers.Items.Item[lvCustomers.ItemIndex].Detail);
    InvoiceQuery.ExecSQL();
    InvoiceQuery.Open;
    InvoiceQuery.Next;
  end;
end;

Open in new window

With the code above I can click on any customer name and when it shows the next listview it has the same customer no matter which custmer I choose from the lvCustomers.
CusCLickWronge

------------------------------------------------------------------------------------------------------------------------------------------------
If I take out the EOF code then  it will show the correct Invoices that matches the customers ID, BUT I throws and error on the last record I click on.
   InvoiceQuery.Active:= True;
  // while not  InvoiceQuery.Eof do
 //begin
    InvoiceQuery.SQL.Text:=('Select Customers.Name,Customers.ID,Invoice.CusID From Customers Inner Join Invoice On Invoice.CusID = Customers.ID Where Customers.ID = :lvcusDetail');
    InvoiceQuery.ParamByName('lvcusDetail').asinteger := strToInt(lvCustomers.Items.Item[lvCustomers.ItemIndex].Detail);
    InvoiceQuery.ExecSQL();
    InvoiceQuery.Open;

 // end;
  InvoiceQuery.Next;
  TabControl1.ActiveTab:= tiInvoice;

Open in new window

Last
Thanks for your help.
CusClick.jpg
Wrong-Record.jpg
last.jpg
0
Hi I need to drill into the ItemAppearance of the tlistview and ,
Showmessage of Footer, Header, Item.
0
I am writing a program using Delphi 6 which I would like to run from a USB flash drive and I want to record the serial number of each flash drive when the software is copied to it for the first time.  When the program is opened I want to compare the serial number of the flash drive to the one I recorded when the flash drive software was created.  I don't want the serial number of the drive's volume when formatted.  This is the hardware serial number.  I have found a couple of methods that work but they fail when Vista/Windows 7/8 is used.
0
Hi All:
i've an edit box this edit box for numeric values. i'd like to make this edit box accept just numeric values i wrote on key press  the following

         IF NOT((Key IN ['0' .. '9']) OR (Key = #8) OR (Key = #17)OR (Key = #67)OR (Key = #86) OR (Key = #118)OR (Key = #88)OR (Key = #13)) THEN
                Key := #0;

but this code stop the ctrl+v, ctrl+c and ctrl+x

can you please help me to fix this issue and lets the edit box accept (ctrl+v).
0
I need a function that will send our pending reports every hour on the hour.  That sounds simple but I cannot figure out how to do it.  If I could find any component set that would do it I'd be happy to buy it.  Thanks
0
Hi,

The subject says most of it.  I'm using delphi XE3.

Does it exist libraries or example code that can enumerate every network
interface detected in winxp - win8 and let me retrieve its traffic
counter's amount, name and status?

Thanks a lot for help on this issue

best regards Tor
0
I have been working on a bit of code that loads data from 5 sources into a client dataset.  The data can then be indexed and manipulated to update the screen.  I ran into a spot in my code, while debugging, that set the CDS FilterName.  This should not be a problem but I noticed a watch I had setup to display the RecordCount property went from 1 to 0.  Can anyone tell me why a client dataset would behave like that?
0

Pascal

Pascal is an influential imperative and procedural programming language, largely (but not exclusively) intended to teach students structured programming and data structuring. Pasca was implemented on a wide range of architectures, from early PCs to mainframes. Pascal derivatives include OOP-based Object Pascal (used in Delphi and Lazarus/Free Pascal). Pascal is a purely procedural language and includes control statements with reserved words, but has many data structuring facilities and other abstractions like type definitions, records, pointers, enumerations, and sets.

Top Experts In
Pascal
<
Monthly
>

No Top Experts for this time period. Answer questions to earn the title!