* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
Spanish / Re: imprimir fotos desde lazReport
« Last post by Bobito on Today at 12:50:33 am »
Mi versión de Lazarus es la más reciente 1.8.4,  uso firebird 2.5, y ciertamente uso insertar image. Curiosamente cuando lo ejecuto desde el IDE contrario a lo que le sucede a GAN, no hay problema, sí muestra las fotos. El problema es cuando ejecuto el .exe. Estoy pensando que probablemente el problema se origine al ligar las fotos al campo photo en la tabla employees desde dbTour Pro a través del editor de blobs. Como debiera grabar esa información en la tabla? Gracias un millón por su apoyo.
2
General / Re: Please make your language more freedom
« Last post by lainz on Today at 12:47:25 am »
The other day I was trying to change the value of i inside a for loop, and get that can't be done when compiling. Good =) Let's use a while loop instead.

As well I want that warning, trying to use the value of i when I exit, break, exception a for loop.

One can asume the value of i, and that's not good, since I've lost real time debugging a code that reuses an i of a loop, thinking that the value it should have is the one I think, and of course it was not the real one. And I'm talking of Java, not Pascal. The problem can come in any language, but if we can have a clue on what we're doing wrong is very welcome.

And about changing the Language. I know people (I'm one) that's currently developing for Delphi and Lazarus at the same time. Having compatibility between them is good, so I can reuse code from one to the other. And that is possible, I made a library that works in both worlds reusing most of the code, and third party libraries as well.

The thing is to write better code, an extra i declared in the var section will not make you less happy! In fact you had in control everything is used in the same *unique* scope (thanks for that!, really I lost real time debugging scope things in JavaScript as pointed, is a real problem!).

As pointed by others, divide an conquer (split into several functions if you don't want a lot of vars in the same place), or even create functions inside functions, that is good as well.

Edit: fix typo
3
General / Re: Please make your language more freedom
« Last post by Martin_fr on Today at 12:39:02 am »
And to add, it would create new issues:

Code: Pascal  [Select]
  1. procedure foo;
  2. var i: integer;
  3. begin
  4.   for var i: integer := 1 to 9 do
  5.  
This can obviously not be allowed. You must not end up having 2 "i" in the scope. (If you did, mayhem will not wait to happen)

So you could not use a variable for the "for" that already is declared.

But that also means, that in the opposite case, if I need to introduce a new variable for a procedure, I would need to search the entire procedure body, to make sure it isnt used (while today, I can just look at the "var" section, so much easier.)

And IIRC it was stated the new feature would also help if you have really long procedures (which I think is a bad idea anyway). In that case searching the whole body becomes even worse.

So clearly this would be a step in the wrong direction.
4
> Это же часть WinAPI! Почему нету заголовков?!

Потому и нету (я так думаю), что код который работает только на Windows, для Lazarus (являющийся кроссплатформенным) являет малую ценность/приоритет. Так, только в качестве дополнения, в частном порядке, и уж никак не в LCL.


Handoko дал тебе ссылки на темы, там есть вложение .rar, обнови, дополни, выложи, поможешь другим заинтересованным.

P.S. А зачем тебе вообще gdiplus?
5
General / Re: Please make your language more freedom
« Last post by Martin_fr on Today at 12:31:03 am »
introducing improvements does not mean "force to use, knife under neck" afaik I can still program in pure pascal, I mean TP like; all improvements after Object down

So, introducing new concepts would not bother oldies stuck around 1870 years' rules, as long as their old fashioned sources still work the right way with no change. Ever heard about "backward compatibility"?

Doesn't really answer my question: why "for" but not "if"?
That of course is, assuming we agreed above that it was for "for" only, and not for "if".

As for your statement, which is a repeats:
No, it is "force to use". Because it will appear in public components that will have to be used. Or worse, it will appear in the rtl. The alternative is, that it will reduce the available libraries, it will make important security update unusable, ....

Variables declared ahead of the procedure (or the breakage of this) is not a feature. It is changing the fundamental design of the language.

<sarcasm>
With your argument in mind, I could also say that a modeswitch could be added, that makes {} tokens for begin/end (and (**) can be used for comments). It would be just optional so no harm.
And "*" or "->" could be used for pointer deref...
</sarcasm>

But again, even if we do not ask: why "for" but not "if"?
The question still stands: How does it help against uninitialized variables? As I said, you have uninitialized variables in c, or javascript too.

For the for loop that problem can be fixed, by having fpc issuing a warning (you can tell fpc to treat warnings as errors, so then it really will stop the issue: -Sew )

6
BGRABitmap and LazPaint / Re: BGRABitmap demo projects
« Last post by lainz on Today at 12:30:28 am »
Hi, these days I've added:
- Fractal Tree
- Fractal Tree 2 (thanks to my brother, learning Pascal, one of his first programs)
- Superformula UI

And now we have 12 demo projects.  :)

Unfortunately, I tried but can't fix the Superformula UI (https://forum.lazarus.freepascal.org/index.php/topic,41646.msg289478.html#msg289478) to stop breaking the application with SIGFPE exceptions sometimes, seems that I'm doing something wrong that I can't fix. So in it's current state, is not good idea to try to include it in LazPaint.

Well, I'm not sure how far this will go. There are always fun and interesting things to code with BGRABitmap.

But I'm sure these are enough for anyone wanting to start with BGRA. There are animations, Canvas2D, images, user input and more.
7
General / Re: Invalid Math Operations
« Last post by lainz on Today at 12:16:03 am »
I added a threshold to 0.1 in the numeric edits in the UI version, less graphics can be generated by the user, but it still was working... and then I try with combinations of big numbers and it can break as well.

I think as it's coded is not as safe to include into a paint application.. only to get the user losing his work.
8
Linux / Re: Installs on Linux Mint - won't rebuild
« Last post by sash on June 23, 2018, 11:57:40 pm »
I believe Mint is a Debian derivative? Why don't you use latest .debs from Sourceforge?
Never liked Debian stock packages, because they are lagging versions and weirdly structured.
9
General / Re: Please make your language more freedom
« Last post by mercurhyo on June 23, 2018, 11:35:05 pm »
huh!?
introducing improvements does not mean "force to use, knife under neck" afaik I can still program in pure pascal, I mean TP like; all improvements after Object down

So, introducing new concepts would not bother oldies stuck around 1870 years' rules, as long as their old fashioned sources still work the right way with no change. Ever heard about "backward compatibility"?

the concept I suggested has multiple advantages (comprising avoiding 4 pages discussing long time issue over variables values on loops exits ha ha ha) and is not a forced plan. people used to declare vars on local stack and using old mode loops could continue without change! Transparently!
I however BET that if my concept (jamie delivered almost same) is adopted as enhancement, a majority of programmers are going to use that optional syntax
10
Third party / TGIFViewer component
« Last post by BeanzMaster on June 23, 2018, 11:23:22 pm »
Hi, to all

I'm proud to share with you my component TGIFViewer

TGIFViewer is a visual component for displaying animations at GIF (Graphic Interchange Format) with Free Pascal and Lazarus

Compatibility: Windows, Linux and MacOS

Capabilities of TGIFViewer:

  • Loading from a stream, file, or resource (LoadFromStream, LoadFromFile, LoadFromResource functions)
  • Extraction of raw images (** DisplayRawFrame function)
  • Extraction of pre-calculated images from the animation (DisplayFrame function)
  • Display with or without transparency (Transparent)
  • Silent management of some badly encoded data to allow the display of images without disturbing the user
  • Error handling for poorly compressed files '(OnLoadError)
  • Center (Center), Resize (Stretch) the display
  • Dimension of the automatic component according to the image (AutoSize)
  • Evident when playing, stopping or pausing the animation (OnStart, OnPause, OnStop)
  • Access to GIF images and information via the Frames.Items property

Also contains 2 units:

  • uFastBitmap: Class for handling 32-bit bitmap in RGBA or BGRA format depending on the OS
  • TypesHelpers: Classes that add useful functions to the data type (Byte, integer, string, double, TDateTime ...) functions can be accessed directly through the completion of the code under Lazarus.

You can download GIF-ImageTestSuite : https://github.com/jdelauney/GIF-ImageTestSuite for testing with several differently encoded GIFs

Installation:
  • In Lazarus go to the 'Package' menu and select 'Open a package file (' .lpk ')
  • Select gifviewer_pkg.lpk from the Package folder
  • Click on the 'Compile' button
  • Click on the 'Use' button and then 'Install'

The TGIFViewer component will be installed in the Beanz Extra section

Note:
The GifView demo application of the Demos folder does not require the installation of the component in the IDE to work.

License: MPL
© ️ 2018 J.Delauney (BeanzMaster)

Download from Github : https://github.com/jdelauney/TGIFViewer


French topic here : https://www.developpez.net/forums/d1867467/autres-langages/pascal/lazarus/annonce-composant-tgifviewer/

Best regards
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus