Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Keep in mind also that if the substitutions are not runtime, how will you manage translation ?

One of the reasons format exists is that the strings can be translated.

These two concerns live in separate worlds.

Interpolation isn't a replacement for Format in user-facing translatable strings - it's a replacement for Format (and string concatenation) in the vast majority of strings that are never translated: log messages, exceptions, debug output, generated SQL, code generation, assertions, internal tooling, etc. If you want a translatable string, you still write it as a resourcestring and pass it to Format, exactly as today. Interpolation doesn't take that away.

And if anyone is worried about people accidentally interpolating a resourcestring, that's trivially solvable at the compiler level - forbid $'...' on a resourcestring, or warn on it.

Plenty of other languages have both interpolation and i18n side by side. Translation concerns never stopped any of them from adding interpolation - and they shouldn't here either.
2
Pascal and AI / Re: Can /my/ AI help me with pascal coding?
« Last post by schuler on Today at 03:27:59 am »
@domaz,
Quote
2) BZ2 - it's the last popular compressor we don't have in pure Pascal. We have a decompressor but not compressor.
https://github.com/libarchive/bzip2

I have not properly tested:
https://github.com/joaopauloschuler/pas-bzip2
3
Games / Re: Untitled raycaster game (WIP)
« Last post by etrusco on Today at 02:54:01 am »
Very well done, looks lovely! Finally a more advanced game in Free Pascal. 8)

What, you don`t think Castle Engine is advanced enough? O_o
4
General / Re: Little bit...
« Last post by mas steindorff on Today at 02:03:39 am »
thanks, that clears thing up for me.  I tend to think of strings as something complex (managed) so I've avoid them as variants.  It makes since they would be safe to pass as a const if you are not modifying them.
5
General / Re: Little bit...
« Last post by jamie on Today at 01:54:14 am »
Array of constants have been part of the language as far as I can remember, however, Tstringlist does not have that, it's simply added for an example.

You can, however, make a custom input because for each element of the array, there is type information that allows you can examine and treat it like a random input scenario.

 It's like working with an array of variants.

Jamie
6
Pascal and AI / Re: Can /my/ AI help me with pascal coding?
« Last post by schuler on Today at 01:48:50 am »
@domaz,
Quote
1) ZSTD - it would be nice to have a fast compressor in pure Pascal:
https://github.com/facebook/zstd

What about https://github.com/DenisAnisimov/ZSTD.pas ?
7
Translations / Re: Translate .lfm file in a lazarus package
« Last post by wp on Today at 01:40:24 am »
I asked Maxim, the maintainer of the Lazarus translation system, about this issue, and he told me that extraction of strings from lfm files in packages probably is not implemented. He anyway recommends to use only resource strings rather than these auto-created strings which have several disadvantages: impossibility to assign a string to several captions (which is an unnecessary load for the translators), requiring manual maintaining of lists of strings to be excluded from the po file, requirement to still use resource strings because the auto-strings cannot be created in many cases (comboboxes, radiogroups, ...).

I picked up this recommendation and reworked the ChartEditor demo project (in components/tachart/demo/charteditor) to move all the editor dialogs into a package and to introduce translations based on resource strings only. Well, this project has a variety of frames and forms, and it took me some time to set up all the resource strings. But on the other hand, having all package strings in a dedicated unit, is a very clear concept, much clearer than the confusing auto-extracted strings. I am posting this project/package here for you to study. Note that before you load the demo you must install the package from its dedicated folder. In the "Settings" menu there is an item to switch language between English and German. Click on any chart element to open its corresponding editor.
8
Packages and Libraries / Re: DataPort or Synpase status
« Last post by mas steindorff on Today at 01:39:31 am »
I've only used synpase and later LazSynaSer but as a hardware man, an async port means independent send and read operations.
unless DataPort offers you some thing I sugest you look at using  hardware handshaking (RTS/CTS) setting it before you send something and clear it when done (which is harder due to buffering). RTS/CTS are more like suggestions, allowing a few more bytes to be sent before pausing. Event the UART chips back in the 80s had an internal 15 byte buffer.

LazSynaSer does include  .OnEndOfBlock and .onShowStatus call backs that allow access to some low level OS event reporting, but I believe this will be Driver dependent.
Most VCP come with buffers several hundred bytes big that you may be trying to degrade. a USB<=>bridge driver will wait until (timeout or byte count) before it passes the stream to it's device using a USB block transfer. You may be forced to sent one byte at a time at a low baud rate in order to bypass these OS driver buffers.
hope this post helps.  MAS   
9
General / Re: Little bit...
« Last post by mas steindorff on Today at 12:55:42 am »
The above code is a reworking of some code I saw many years back, so you may also have seen it before.
(Only change is basically Add(Format(Fmt,Args)) dropped for Add(Fmt,Args);
Just looking for some more info...
1: Are you saying .Add with 2 parameters will automatically use the 1st as a format string?  (The TStringList document doesn't say anything about this)

2: I can say I've ever passed a string to a procedure in an "array of const". Is this something newly added after FPC 3.2 or have I missed out in my studies? 
MAS
10
Games / Re: Untitled raycaster game (WIP)
« Last post by hukka on Today at 12:12:06 am »
Very cool, nice to hear this! I hope more people will be inspired to create more serious games in Free Pascal, because this language is practically nonexistent in the game development sector (even though it’s IMO much better suited for it than, say, C++). Good luck—I’m rooting for you!

It will definitely have a big "Made with Free Pascal" logo in it!

Quote
But if you'd prefer to stick with SDL3, SDL_mixer 3.0 supports 3D audio positioning—the MIX_SetTrack3DPosition function is used for this. However, I haven't tested this mixer yet, so I'm just going by the documentation.

Thanks for the heads up! I hadn't realized there was already support for 3D audio within SDL - if I get that far I will transfer to using SDL_mixer just to avoid having to pay the license fee for commercial usage of BASS.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018