Recent

Author Topic: [SOLVED] About Barcode.pas  (Read 14863 times)

Kevinn33

  • New Member
  • *
  • Posts: 26
[SOLVED] About Barcode.pas
« on: April 03, 2018, 03:55:30 pm »
hello, i am new to pascal and lazarus,
i wonder why i cant view the barcode that was generated, the source is from here(pict)

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, LR_BarC, Forms, Controls, Graphics, Dialogs,
  9.   StdCtrls,barcode, LR_Class, LR_View;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     Button1: TButton;
  17.     frBarCodeObject123: TfrBarCodeObject;
  18.     frPreview1: TfrPreview;
  19.     Label1: TLabel;
  20.     procedure Button1Click(Sender: TObject);
  21.   private
  22.  
  23.   public
  24.  
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.lfm}
  33.  
  34. { TForm1 }
  35.  
  36. procedure TForm1.Button1Click(Sender: TObject);
  37. begin
  38.    frBarCodeObject123:= TfrBarCodeObject.Create(self);
  39.    label1.Caption:= '123';
  40. end;
  41.  
  42. end.
  43.  
« Last Edit: April 04, 2018, 12:44:59 am by Kevinn33 »

balazsszekely

  • Guest
Re: about Barcode.pas
« Reply #1 on: April 03, 2018, 05:14:29 pm »
Did you try: ($LazarusDir)/components/lazreport/samples/barcode/ ?

Kevinn33

  • New Member
  • *
  • Posts: 26
Re: about Barcode.pas
« Reply #2 on: April 03, 2018, 06:03:07 pm »
@GetMem, Tried but i dont want to use its report
i just want to show the barcode, then the next step will be print it.

well i got it fixed
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, LR_BarC, Forms, Controls, Graphics, Dialogs,
  9.   StdCtrls, ExtCtrls,barcode, LR_Class, LR_View;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     Button1: TButton;
  17.     frBarCodeObject123: TfrBarCodeObject;
  18.     frPreview1: TfrPreview;
  19.     Label1: TLabel;
  20.     PaintBox1: TPaintBox;
  21.     procedure Button1Click(Sender: TObject);
  22.   private
  23.  
  24.   public
  25.  
  26.   end;
  27.  
  28. var
  29.   Form1: TForm1;
  30.  
  31. implementation
  32.  
  33. {$R *.lfm}
  34.  
  35. { TForm1 }
  36.  
  37. procedure TForm1.Button1Click(Sender: TObject);
  38. var
  39.   Barcode : TBarcode;
  40. begin
  41.      Self.Caption:='123123';
  42.      Barcode := TBarcode.Create(Text);
  43.      Text:='12345';
  44.      Label1.Caption:='berhasil';
  45.      Barcode.Height:= 20;
  46.  
  47.      Barcode.DrawBarcode(PaintBox1.Canvas);
  48.  
  49.  
  50. end;
  51.  
  52. end.
  53.  

But i still cant change the barcode number.. it shows 000000000, and i dont understand what is -> self

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: about Barcode.pas
« Reply #3 on: April 03, 2018, 06:29:32 pm »
... and i dont understand what is -> self

From that I read: I really have no clue about the language I use now...

Bart

balazsszekely

  • Guest
Re: about Barcode.pas
« Reply #4 on: April 03, 2018, 06:54:03 pm »
If you don't want to use reports try this: http://wiki.freepascal.org/LazBarcodes

Kevinn33

  • New Member
  • *
  • Posts: 26
Re: about Barcode.pas
« Reply #5 on: April 03, 2018, 07:12:32 pm »
@Bart  :D :D :D yeah .-. i'm new to this,
i've just learn from afew piece of program..

maybe if you could help with where i can study from first?

tried lazbarcodes, but it appears only show QR codes, no source telling that i can do 1D codes,

saw this post ending, looks convincing but dont understand most of it

balazsszekely

  • Guest
Re: about Barcode.pas
« Reply #6 on: April 03, 2018, 07:59:54 pm »
@Kevinn33
I'm out of ideas....

1. Please take a look at this example(package lazbarcodes): http://forum.lazarus.freepascal.org/index.php/topic,29997.msg190460.html#msg190460
2. If lazbarcodes is not what are you looking for, there is one more package you can try, but first you must uninstall lazbarcode to prevent duplicated unit error: https://packages.lazarus-ide.org/Barcodes.zip (see attached image)

Kevinn33

  • New Member
  • *
  • Posts: 26
Re: about Barcode.pas
« Reply #7 on: April 04, 2018, 12:44:04 am »
I would like to say many thanks @GetMem  :) :D

thats exactly what I wanted, Simple and easy to use
I wonder why I cant search it anywhere for that
« Last Edit: April 04, 2018, 12:45:40 am by Kevinn33 »

RasDev

  • Newbie
  • Posts: 1
Re: [SOLVED] About Barcode.pas
« Reply #8 on: December 26, 2021, 03:31:11 pm »
@Kevinn33
I'm out of ideas....

1. Please take a look at this example(package lazbarcodes): http://forum.lazarus.freepascal.org/index.php/topic,29997.msg190460.html#msg190460
2. If lazbarcodes is not what are you looking for, there is one more package you can try, but first you must uninstall lazbarcode to prevent duplicated unit error: https://packages.lazarus-ide.org/Barcodes.zip (see attached image)

is https://packages.lazarus-ide.org/Barcodes.zip not available anymore?

alaa123456789

  • Sr. Member
  • ****
  • Posts: 260
  • Try your Best to learn & help others
    • youtube:
Re: [SOLVED] About Barcode.pas
« Reply #9 on: December 26, 2021, 05:26:03 pm »
you could use the fonts , for example check the following website
https://www.fontspace.com/category/bar-code

hope it is useful

thanks

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1111
  • Professional amateur ;-P
Re: about Barcode.pas
« Reply #10 on: December 27, 2021, 12:38:12 am »
Hey GetMem,

2. If lazbarcodes is not what are you looking for, there is one more package you can try, but first you must uninstall lazbarcode to prevent duplicated unit error: https://packages.lazarus-ide.org/Barcodes.zip (see attached image)

While I was doing my QR Code tests I came upon the fact that LazBarcodes does not have 1D code.
The thing is, in my past, I was able to play around with 1D codes AND the QR Code components. I quite vividly remember this.
And now that you posted this link: https://packages.lazarus-ide.org/Barcodes.zip(Which is a 404 incidently), it clicked...
The package that I used to install with all the 1D and 2D components was called Barcodes and not LazBarcodes.

So, now I ask, dear friend GetMem, when did one get dropped and the other came about?

And are we sure they are incompatible?

If so, I want to have access to the OLD one, Barcodes, not the new one which is missing half of what they advertise :)

Maybe you can shed some light on this matter.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

balazsszekely

  • Guest
Re: [SOLVED] About Barcode.pas
« Reply #11 on: December 27, 2021, 07:21:50 am »
Hi Gus,

Quote
now I ask, dear friend GetMem, when did one get dropped and the other came about?
Unfortunately I cannot recall any details. Personally I never used any of those packages.

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: [SOLVED] About Barcode.pas
« Reply #12 on: December 27, 2021, 08:51:11 am »
I used the wayback machine and did not find Barcodes.zip only LazBarcodes.zip . Misterious

https://web.archive.org/web/20170527221914/http://packages.lazarus-ide.org/
regards
Andreas

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: [SOLVED] About Barcode.pas
« Reply #13 on: December 28, 2021, 09:13:22 am »
hello,
I used the wayback machine and did not find Barcodes.zip only LazBarcodes.zip . Misterious

https://web.archive.org/web/20170527221914/http://packages.lazarus-ide.org/
it seems that the components are in the systools package   -> try to install systools in OPM .
In attachment barcode of a Code128 type with systools.
Friendly, J.P




« Last Edit: December 28, 2021, 10:00:40 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: [SOLVED] About Barcode.pas
« Reply #14 on: December 31, 2021, 08:18:16 am »
hello,
ultimately i have found the history of the Barcodes package : it came from the package pl_barcodes of CodeTyphon and has been deleted from Lazarus because it used a part of systools and lazBarcodes code. But the problem is that in lazBarcodes there isn't 1D barcodes and systools seems to have problem to be compiled with lazarus 64 bits. I have recreated the package (in attachment) from pl_barcodes package of CodeTyphon 7.5.1 with ct2Laz converter.
Seems to be OK on windows 10 Lazarus 2.0.12 64 bits and Ubuntu 20.04 Lazarus 2.1.0.
If you use this package, don't use systools and lazBarcodes packages.

Friendly, J.P
« Last Edit: December 31, 2021, 10:34:19 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

 

TinyPortal © 2005-2018