Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Networking and Web Programming / Re: Who is Indy mattias?
« Last post by jollytall on Today at 02:27:19 pm »
Thanks, it is like magic. It works.

However, I still do not understand:
- How mattias is hardcoded in so many places?
- How could it work in the past with - I guess the same - Indy10 without adding Interfaces?
What is Interfaces, anyway? Why I never met it before?

Thanks.

2
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by TRon on Today at 02:26:53 pm »
Is the point the "definition" ?
Yes.

And as a consequence how your code calls that routine (e.g. what parameters (types) you pass it).
3
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by paule32 on Today at 02:15:29 pm »
it is a little bit hard to follow the postings from 440bx.
Is the point the "definition" ?
4
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by KodeZwerg on Today at 02:08:54 pm »
You're missing the whole point.
After reading I do agree you.
5
Unix / Re: A fairly simple sound solution?
« Last post by paweld on Today at 01:46:11 pm »
6
Graphics / Re: Demoscene The Champs Cracktro
« Last post by KodeZwerg on Today at 01:45:18 pm »
Here are some copperbars :D
Code: Pascal  [Select][+][-]
  1. unit uMain;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   BGLVirtualScreen, BGRAOpenGL, BGRABitmap,
  10.   BGRABitmapTypes, BGRAGradientScanner;
  11.  
  12. type
  13.   TCopperBar = packed record
  14.     Gradient: TBGRACustomGradient;
  15.     Y: Integer;
  16.     Size: Integer;
  17.     IsAdd: Boolean;
  18.   end;
  19.   TCopperBars = array of TCopperBar;
  20.  
  21. type
  22.  
  23.   { TForm1 }
  24.  
  25.   TForm1 = class(TForm)
  26.     BGLVirtualScreen1: TBGLVirtualScreen;
  27.     Panel1: TPanel;
  28.     Timer1: TTimer;
  29.     procedure BGLVirtualScreen1Redraw(Sender: TObject; BGLContext: TBGLContext);
  30.     procedure BGLVirtualScreen1Resize(Sender: TObject);
  31.     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
  32.     procedure FormShow(Sender: TObject);
  33.     procedure Timer1Timer(Sender: TObject);
  34.   strict private
  35.     FCB: TCopperBars;
  36.     FMaxBars: Integer;
  37.   private
  38.     procedure ReleaseCB;
  39.     procedure GenerateCB(const AMaxBars: Integer);
  40.   public
  41.   end;
  42.  
  43. var
  44.   Form1: TForm1;
  45.  
  46. implementation
  47.  
  48. {$R *.lfm}
  49.  
  50. { TForm1 }
  51.  
  52. procedure TForm1.BGLVirtualScreen1Redraw(Sender: TObject;
  53.   BGLContext: TBGLContext);
  54. var
  55.   i: Integer;
  56.   sy: Integer;
  57. begin
  58.   for i := High(FCB) downto Low(FCB) do
  59.     for sy := 0 to FCB[i].Size do
  60.       begin
  61.         if FCB[i].IsAdd then
  62.           Inc(FCB[i].Y)
  63.         else
  64.           Dec(FCB[i].Y);
  65.         if FCB[i].Y < BGLContext.Canvas.ClipRect.Top then
  66.           FCB[i].IsAdd := True;
  67.         if FCB[i].Y > BGLContext.Canvas.ClipRect.Height then
  68.           FCB[i].IsAdd := False;
  69.         BGLContext.Canvas.FillRect(0, FCB[i].Y, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y), FCB[i].Gradient.GetColorAtF(sy));
  70.         if FCB[i].IsAdd then
  71.           BGLContext.Canvas.FillRect(0, FCB[i].Y - FCB[i].Size, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y - FCB[i].Size), FCB[i].Gradient.GetColorAtF(FCB[i].Size - sy))
  72.         else
  73.           BGLContext.Canvas.FillRect(0, FCB[i].Y + FCB[i].Size, BGLContext.Canvas.ClipRect.Width, Succ(FCB[i].Y + FCB[i].Size), FCB[i].Gradient.GetColorAtF(FCB[i].Size - sy));
  74.       end;
  75. end;
  76.  
  77. procedure TForm1.BGLVirtualScreen1Resize(Sender: TObject);
  78. begin
  79.   ReleaseCB;
  80.   GenerateCB(FMaxBars);
  81. end;
  82.  
  83. procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
  84. begin
  85.   ReleaseCB;
  86.   CloseAction := caFree;
  87. end;
  88.  
  89. procedure TForm1.FormShow(Sender: TObject);
  90. begin
  91.   Randomize;
  92.   GenerateCB(10);
  93.   Timer1.Interval := 50;
  94.   Timer1.Enabled := True;
  95. end;
  96.  
  97. procedure TForm1.Timer1Timer(Sender: TObject);
  98. begin
  99.   BGLVirtualScreen1.Repaint;
  100. end;
  101.  
  102. procedure TForm1.ReleaseCB;
  103. var
  104.   i: Integer;
  105. begin
  106.   for i := High(FCB) downto Low(FCB) do
  107.     begin
  108.       FCB[i].Size := 0;
  109.       FCB[i].Y := 0;
  110.       FCB[i].IsAdd := False;
  111.       FCB[i].Gradient.Free;
  112.       FCB[i].Gradient := nil;
  113.     end;
  114. end;
  115.  
  116. procedure TForm1.GenerateCB(const AMaxBars: Integer);
  117. var
  118.   i: Integer;
  119.   Y: Integer;
  120. begin
  121.   FMaxBars := AMaxBars;
  122.   SetLength(FCB, FMaxBars);
  123.   Y := BGLVirtualScreen1.Height;
  124.   for i := Low(FCB) to High(FCB) do
  125.     begin
  126.       FCB[i].Size := 10;
  127.       Y := Y - (FCB[i].Size);
  128.       FCB[i].Y := Y;
  129.       FCB[i].Gradient := TBGRAMultiGradient.Create([RGBToColor(Random(High(Byte)), Random(High(Byte)), Random(High(Byte))), clBlackOpaque], [0, FCB[i].Size], True, False);
  130.       FCB[i].IsAdd := True;
  131.     end;
  132. end;
  133.  
  134. end.
7
Unix / Re: A fairly simple sound solution?
« Last post by Giorgos on Today at 01:37:13 pm »
THANKS guys for your help!!!   :D

@Handoko:

I already read this topic amongst other similar.
Don't take it wrong, but these posts are 7-8yo.
Linux (unlike Windows) is somewhat  hostile, against older versions or aged software.
Try running binaries, or compile code so old...well...good luck with it!   :D

@ KodeZwerg:

I'll definitely try it, but it isn't what I was looking for.
For an enhanced "Hello World" program, maybe with colorized output (eg. Cyan instead of white letters) and wanting to make a simple sound (just to demonstrate the ability), messing with complex RAD functions, is not really helpful.

THANKS again!!!   :)
8
Databases / Re: Database standards OR Am I doing this right?
« Last post by paweld on Today at 01:07:33 pm »
I use an additional column for this purpose. Example structure:
Code: SQL  [Select][+][-]
  1. CREATE TABLE testtab (
  2.   id NUMERIC IDENTITY(1,1),
  3.     name VARCHAR(50) NOT NULL,
  4.     qty DECIMAL(14,4) NOT NULL,
  5.     price DECIMAL(12,2) NOT NULL,
  6.     description VARCHAR(200) NULL,
  7.     blocked INT NULL, /*is null then if is null then the record is not blocked (not edited) by any user. If it is edited then the field contains the id of the user who is blocking this record*/
  8.     CONSTRAINT pk_testtab PRIMARY KEY clustered (id ASC)
  9. )
9
Networking and Web Programming / Re: Who is Indy mattias?
« Last post by paweld on Today at 12:58:14 pm »
Add the Interfaces unit to uses section
10
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by 440bx on Today at 12:42:21 pm »
@440bx, okay since you are not stopping to blame my code, you have my full working testcode, make it crash boom bang, can you?
If you managed to make it crash, show what you modified that it can crash.
You're missing the whole point.  That definition of WriteFile is wrong and, as I stated in a previous post, the fact that it can be made to work does _not_ change that.  It is still wrong.

I and, just about anyone, can make that incorrect definition work too, as a matter of fact, I have throw away code (that I haven't thrown away yet) that uses it.   (guess how I noticed the definition is wrong)

What neither you nor anyone can do, is code a call to WriteFile that complies with MS' spec (the author of the function) using the Pascal definition and make it work.  No one can.  The reason: because the Pascal definition is _wrong_.

Lastly, it isn't about your code, it is about the Pascal definition being wrong/incorect.  That's what it's about.

Programming seems to be the premier activity where errors are worshiped and perpetuated.  We "cannot correct that" (whatever "that" may be) because it would break a lot of wrong code we have and we don't want to correct the code (too much work), if we did, we'd have to test again and we'd run the risk of missing a side effect brought about by the correction.  Can't have that.  Instead, we'll claim it's not wrong, just not "equivalent".

However, in spite of the definition because wrong/incorrect, all those who pretend it is not, are _absolutely right_.

I'm going to call that "binary diplomacy". 
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018