Hello,
I have a big bunch of freepascal code under lgpl, with little
documentation and a lot of identifiers in French, I hesitated a long
time before sending this message, ;-) , but may be it could be useful
for you.
From 2002 to 2017 I've been developing functionalities for printing
documen
I'm not an expert, but a few years ago
I made small project to read data from an Arduino through USB
port. The project was running on Raspberry Pi, on Windows it can
be more tricky( I'm not sure, but I think a device driver is
needed):
https://github.com/jsuzi
You can compile console projects with Lazarus, and even use non visual
components and datamodules. I've coded a dll (several hundred thousand
lines of code too) which is used by console programs on web servers. I
compile the dll with the same lazarus project in Lazarus for Windows
and in Lazar
Le 30/07/2019 à 19:52, James Richters a
écrit :
libusb.pas(1350)
Warning: Library c.dll not found, Linking may fail ! ■
As stated in https://github.com/hansiglaser/pas-libusb/issues/4
it's very likely you'll have to change
{$LINKLIB c}
into
{$li
@Johann: Is the Readme.rst at https://github.com/hansiglaser/pas-libusb
up to date ?
It states that only the legacy version 0.1 of libusb is supported, but
the binary package for Windows on libusb.info is in version 1.0.22.
You can get source code for old versions of libusb on github but it
seem
Here are a few links about msvcrt:
https://support.microsoft.com/en-us/help/154753/description-of-the-default-c-and-c-libraries-that-a-program-will-link
https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=vs-2019
https://docs.microsoft.com/en-us/
It seems that you can just remove
{$LINKLIB c} in libusb.pas.
The libusb from libusb.info cannot be
used because the functions it provides are different, and if you
try to recompile a version before 1.0 like 0.9.4, it fails because
Windows targe
With libusb-win32 I tried to make a small program to list the usb
devices.
I discovered that the constant PATH_MAX had changed from 4096 in
pas-libusb to 512 in libusb-win32-bin-1.2.6.0\include\lusb0_usb.h
line 21 . This was causing an exception.
Now the prog
I tried to make an import for libusb-1.0.22.7z from
https://libusb.info/ .
The import unit is very buggy but I could make a small program to
list the usb devices.
On my machine, it gives the same results that the example program
libusb-1.0.22\examples\bin64\
I've made another (unsuccessful) test, using libusb-compat (
https://github.com/libusb/libusb-compat-0.1/wiki ).
It's a compatibility layer which allows to use the new libusb
1.xx through the old API of libusb 0.1
I get nearly the same results as with libusb-win
I've forgotten to give the command line to compile (change
"C:\lazarus\fpc\3.0.4\bin\x86_64-win64" to your fpc installation):
C:\lazarus\fpc\3.0.4\bin\x86_64-win64\fpc.exe -MObjFPC -Scghi -O1 -g -gl
-l -vewnhibq -Filib\x86_64-win64 -Fu..\pas-libusb\src -Fu.
-FUlib\x86_64-win64 -FE. -olsusb.exe
Zadig
I found a way to make my test with libusb-win32 work. You just need to install a specific driver for the usb device you want to see.
This can be done using Zadig ( https://zadig.akeo.ie/ ). If you change the driver to "libusbK" or "libusb-win32" for a certain device with Zadi
Hi Hansi,
Le 04/08/2019 à 14:05, Johann Glaser a
écrit :
Thanks for your effort and please excuse my late reply, I was busy the
last few days.
With pleasure.
test1library.pas from branch
"libusb-1.0" worked nearly out of the box.
Le 04/08/2019 à 14:07, Johann Glaser a écrit :
Hi James!
Am Donnerstag, den 01.08.2019, 22:45 -0400 schrieb James Richters:
I understand it better now, but I've been out of town and haven't
been able to work on it. I'm not sure what is meant by installing
de
Hi James,
Le 05/08/2019 à 04:40, James Richters a écrit :
Hi Jean,
Thank you very much for your help getting this to work. I’ve
been out of town on a business trip but I’m finally back
now, and tr
Hello
I haven't had time yet to read
everything but I join below a few more tests.
Le 05/08/2019 à 21:38, Johann Glaser a
écrit :
Yay! That looks great!
As a next step you can try test2controlsync.pas
which uses
Hi James,
Le 05/08/2019 à 13:00, James Richters a
écrit :
Hi Jean,
Thank you
very much for posting the zip, I’ll download it and see if I
can figure it out. Also thank you very much f
Le 06/08/2019 à 17:18, James Richters a
écrit :
Any ideas? Is this just from using
i386-win32? Maybe the DLL is only for 64bit? Maybe some
completely unrelated issue? If 64bit is needed, what’s the
Le 06/08/2019 à 17:18, James Richters a
écrit :
I used this command line:
I:\Programming\FPC\3.0.4\bin\i386-win32\fpc.exe
-MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Filib\i386-win32\
-Fu.. -Fu. -FUlib\i386-win32\ -FE. -
Hello, I reproduced the problem.
I run fpcupdeluxe x86_64-win64-win32, this is the log of what I've done:
button Setup+, Options Override, FPC options -gw, then click OK, then click FPC Only
After recompilation by fpcupdeluxe:
Open cmd, cd to fpcupdeluxe\fpc\bin\x86_64-win64
gdb.ex
Static linking :
Le 05/08/2019 à 21:38, Johann Glaser a
écrit :
Referring to your EMail to James, it seems that Vitaly even
got it working with static linking. Especially "$LINKLIB msvcrt"
and "$LINKLIB usb-1.0.dll.a" look promis
Le 08/08/2019 à 12:07, James Richters a
écrit :
Is the
static linking issue just with Windows, and it works on
Linux, or it isn’t working with FPC at all on either?
James
Ooops, sorry. Of course I meant dynamic linking ...
Le 08/08/2019 à 23:32, Johann Glaser a écrit :
Am Donnerstag, den 08.08.2019, 13:14 +0200 schrieb Jean SUZINEAU:
It seems that right out of the box pas-libusb uses static linking for
me.
I think you meant to write "dynamic linking&
Hi James,
Le 09/08/2019 à 02:19, James Richters a
écrit :
so this was strange... it was working before
line 81For J := 1 to Length(PortPath)-1 do
line 82 Write('->',PortPath[I]);
Line 82 is using variable I but it's in a loop
Le 09/08/2019 à 06:33, Jean SUZINEAU a
écrit :
Very often in Windows system functions you have to deal with
records with declared with a length of 1 and the real length
stored a few bytes before in the record.
Oops, not with
Le 09/08/2019 à 14:19, James Richters a
écrit :
Now I have a
new problem. I am able to successfully compile and run my
project with the text IDE if I use the trunk version of FPC,
and I can run the r
Le 09/08/2019 à 12:22, Mgr. Janusz Chmiel a écrit :
Does somebody of you know about Lazarus compatible Unit, which is able
to create Windows GUi with no need to specify object position values
in points or in Pixels?
Something similar like VCL units have for commercial BOrland Delphi.
Or unfortu
Le 09/08/2019 à 15:39, James Richters a
écrit :
I am not
using libusb in my project yet… all that is still just in
separate test programs. This is the original version of my
project, just compiled f
Le 11/08/2019 à 11:43, Mgr. Janusz Chmiel a écrit :
Thank you very much for yours patience. The reason why I want to use
my own little Internet radio player is The fact, that GUI is simple,
many other radio apps are full of functions and of many buttons. I
want to simple pause, play or stop.
I
Le 14/08/2019 à 01:41, James Richters a écrit :
Anyone have any thoughts on all this?
I'm busy for now, but I'll have a look as soon as possible.
Did you try to change your driver with Zadig (https://zadig.akeo.ie/)
for your device 10CE:EB93 ?
___
Le 14/08/2019 à 23:18, Martin a écrit :
inc(CALL_LVL [ LOCAL_CALL ],1)
Yes, "inc" does not work for properties. But neither does +=.
I agree and in the case of a property I think it would be cleaner to
code an Inc method directly in the class, or eventually in a class
helper, to write someth
Le 16/08/2019 à 12:23, James Richters a écrit :
Can you tell me where to get libusb_1.0_X86.dll ?I had the x64 version
from the sample Jean sent me, but I would like to make my program work on 32bit
machines as well.
I think you can get it at
https://github.com/libusb/libusb/releases/down
Le 16/08/2019 à 17:11, James Richters a écrit :
Can I even do threads in a console program?
Yes, you can. I have in production some console code (worse: in a dll
called by a console program written in 4gl (4js Genero www.4js.com))
with threads which compile unmodified under Linux and Window
Le 17/08/2019 à 15:00, James Richters a
écrit :
Function
TLibUsbInterface.FindEndpoint(MatchFunc :
TLibUsbEndpointMatchMethod) : Plibusb_endpoint_descriptor;
MatchFunc(ED) is where the access
vi
Le 17/08/2019 à 17:10, Stefan V. Pantazi a écrit :
The obvious first thing to make sure is that the calling convention
matches the library for the platform. I see that in
https://github.com/Zaaphod/pas-libusb/blob/Hack/src/libusb.pas 9line 46)
the calling convention on Windows is cdecl (the stdc
Le 17/08/2019 à 19:39, James Richters a écrit :
I think maybe it is the calling convention... First I tried to change
libusboop.pas (libusb.pas is the old unit, libusboop.pas is the one it uses) to
stdcall, I was unable to compile it, I get an error
libusboop.pas(1456,28) Error: Incompatible
Hello,
It seems you didn't initialized you critical section using
InitCriticalSection.
The documentation of EnterCriticalSection :
https://www.freepascal.org/docs-html/rtl/system/entercriticalsection.html
The one of InitCriticalSection:
https://www.freepascal.org/docs-html/rtl/system/initcritic
Le 28/08/2019 à 13:26, James Richters a écrit :
Thanks for figuring out the critical section needs to be initialized. Stefan's
example did not do this:
https://github.com/svpantazi/libusbxhid/blob/master/libusbhid_test_with_thread.pp
maybe it's something you can get away with on Linux...
Maybe
Hello,
Le 30/08/2019 à 10:18, Anthony Walter a écrit :
I've posted a new page that tests the speed and correctness of several
pascal based JSON parsers.
https://www.getlazarus.org/json/tests/
it seems you made a typo in your html,
JsonTools points to https://sourceforge.net/projects/lkjson/
Tip: if you need Sin(A) and Cos(A), it can be faster to make a single
call to SinCos instead of two separated calls to Sin and Cos:
https://www.freepascal.org/docs-html/rtl/math/sincos.html
It was efficient 20 years ago when I was developing a sky map software,
may be the gain is negligible to
Wonderful !
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
May be it's not exactly what you are search for, but two years ago I
used an Arduino with an Ethernet shield to control this kind of LED
Strip.
I join below the content of the main file, just 111 lines. It's
very easy to control the led strip from arduino. Contrary to
It's possible but I've done it many
years ago, I don't remember all the details .
In think you'll have to use H2PAS ( https://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries
).
From what I see from main.c, I think
you'll have to
Hello,
Le 19/06/2020 à 13:55, Darius Blaszyk
via fpc-pascal a écrit :
Schema::create('flights', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('air
Le 21/06/2020 à 00:30, Michael Van Canneyt a écrit :
FPC contains this as well since many years, you can drop the
components on a form, but they
are exposed in the lazarus database desktop as well.
Very interesting, I didn't know this existed. I will have look at it.
In fact I developed my co
Le 21/06/2020 à 09:55, Michael Van
Canneyt a écrit :
I use the functionality in the database desktop actively.
The generated code even runs in Delphi.
If you look at it and find ways to improve it, I'm all ears :-)
I
Le 01/09/2020 à 10:49, Bo Berglund via fpc-pascal a écrit :
Is there no way to declare a property to have a default non-zero
value?
I'm not sure but I think the syntax is for this something like
property ReadPacketSize: integer read FPacketSize write FPacketSize default 10;
Reference: https:
Ooops, wrong url, I just learn know that property could belong to a
global block... ;-)
For classes:
https://www.freepascal.org/docs-html/ref/refsu33.html#x86-1080006.7.1
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freep
Another way is to declare TMyRec as class instead of record.
In this case, you don't need the dereference operator ^ .
No need of new and dispose, just Create and Free, as for TMyRecList.
I don't know if there is a better performance when you use a record,
but as far as I know, record/object/n
Personnally I go even further ;-)
if something
then
begin
some multi-line code here
end
else
begin
some multi-line code here
end;
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/m
In my own code I use BlockRead/BlockWrite, but I'm wondering if
I've not seen this somewhere in RTL.
https://github.com/jsuzineau/pascal_o_r_mapping/blob/TjsDataContexte/pascal_o_r_mapping/02_Units/uuStrings.pas
function String_from_File( _FileName: String): String;
Le 09/10/2020 à 10:15, Santiago A. via fpc-pascal a écrit :
Just nitpicking.
Shouldn't "try" be after the "reset" and after the "rewrite"?
Why don't you allow to write an empty string?
Yes, you're right, the Reset/Rewrite should be after the try.
I admit this code is not general, just tailored
I know you don't like objects, but maybe something like :
unit uAxisRecord;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
type
{ TAxisRecord }
TAxisRecord
=
object
X,Y,Z,A,B,C: Double;
function Value_from_Letter( _A
Le 20/12/2020 à 16:02, James Richters via fpc-pascal a écrit :
If I need a bunch of case statements, it's atcually worse than if I just have
separate procedures.
No, in fact the case statement is written only once, in the
implementation of TAxisRecord, and in procedure
Move_It(Axis_Letter:Ch
Amazing !
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
May be using TBlockSerial from unit synaser from Ararat Synapse ?
( doc: http://synapse.ararat.cz/doc/help/synaser.TBlockSerial.html ,
download: http://synapse.ararat.cz/doku.php/download ).
Given a variable (SynSer: TBlockSerial;), you can test if data is
available with SynSer.CanReadEx(0) an
Le 28/12/2020 à 13:16, Bo Berglund via fpc-pascal a écrit :
Synchronize(CallEvent); //Supply received data in FBuffer to
caller
You are using TThread.Synchronize.
In a console app, it's likely that somewhere else in your main thread
you'll need to call regularly Classes.CheckSynchron
Le 01/01/2021 à 00:48, James Richters via fpc-pascal a écrit :
I’m not too familiar with PChars, but is there a way to set it to zero
length?
I set it to #0 and it works ok with the #0 in there with Notepadd++
but I think it’s technically not correct.
For me, it's correct. C strings are ju
Normally something like this should do the trick (here 3 decimals and 7
characters for total width):
program Format_Example;
uses
sysutils;
procedure F( _d: double);
var
S: String;
begin
S:= Format('%7.3f',[_d]);
WriteLn( S);
end;
begin
F(0.5);
F(2.53);
F(12.5);
Le 04/04/2021 à 02:41, James Richters a écrit :
That looks almost perfect.. can I suppress the trailing zeros with the
format command without losing the alignment?
As far as I know, no ...
Not with just the RTL.
Anyway I have personal code for this, you can extract and customize it
to yours
As far as I understand, you are searching for a general tree component
like TTreeView in Lazarus, but for FreeVision, running in text mode in
console ?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/m
If you just select files, as Bart stated in another message, I think
TShellTreeView will be more adequate and easier than TTreeView (actually
TShellTreeView is a file tree specific descendent TTreeView).
In TTreeView (and TShellTreeView) you can enable multiselection by
adding tvoAllowMultiSel
(I re-send my mail with different sender, it seem the first one has been
blocked by orange)
I made a short example based on TTreeView with your data at :
https://github.com/jsuzineau/pascal_o_r_mapping/tree/TjsDataContexte/tools/FileTree
You just need to download all the files , open project F
Indeed, I think it's difficult (if possible) to change the behaviour of
the multiselection this way.
The TTreeview.MultiSelectStyle property allows you to change from
CtrL+Click to Shift+Click.
https://lazarus-ccr.sourceforge.io/docs/lcl/comctrls/tmultiselectstyle.html
To make the multi sele
TStringList works pretty much like an inifile section.
The index corresponds to the line number in you text block.
The Names property corresponds to the part of the line before the '=' char.
The ValueFromIndex property corresponds to the part of the line after
the '=' char.
So if you line i conta
I have updated the VirtualTreeView example with sub-totals of time.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Le 13/04/2021 à 13:50, James Richters via fpc-pascal a écrit :
I tried to make a fork of your repository but I could not change off the master
branch,, I always get an error: Checkout Failed Cannot checkout to invalid
path 'tools/text_glCAPI\jsLignes.Exclus.txt' I suspect the / in the path i
Le 14/04/2021 à 13:06, James Richters via fpc-pascal a écrit :
I still can’t get off the Master branch on my windows machine. I
deleted everything, re-forked it, re-cloned it,
I finally found on my linux machine a 'test_gICAPI\jsLignes.Exclus.txt'
file right in tools directory, and remo
Le 15/04/2021 à 15:31, James Richters via fpc-pascal a écrit :
How did you make the TVirtualStringTree open the first level? I've been
looking to see how you did it but I don't see how that was done.
unit uFileVirtualTree, line 360, method
ThVirtualStringTree.vst_expand_first_level;
I would
Le 15/04/2021 à 20:16, James Richters via fpc-pascal a écrit :
It doesn't have to be a PDF, it could be an image file, or even a text
file...maybe I can just make a text file of the output and use box
characters to draw the tree. It seems like I should be able to get the
branches of the treedat
In Unicode/UTF8 "char" can be represented by several bytes so my code
won't work.
It seems you use page code 850 (here in France we are in 1252 which
doesn't have the box chars).
In unit uFileVirtualTree line 469, I have added type String850= type
String(850);
declared the local variable
Le 18/04/2021 à 16:10, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree I getuFileVirtualTree.pas(533,9)
Error: identifier idents no member "DefaultEncoding"
It seems, using svn blame, that DefaultEncoding has been added in
FreePascal source trunk on the svn server on June
Le 18/04/2021 à 17:22, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
I figured out how to make a pdf file, but I don’t know how to
implement it… if we can just have a button to print result.txt… then I
could just change the printer to Microsoft Print to PDF which is
i
Another way of seeing is to generate and odt file with the generated text.
You get a slightly better rendering because I could define Courier New
as default font in the new template: FileVirtualTree_txt_to_odt.odt
From the OpenOffice "File" menu, you can generate a pdf file.
There is a way to
Le 22/04/2021 à 23:17, James Richters via fpc-pascal a écrit :
For some reason the ODT file wants to know if I want to translate it
from French, and while the font is “Courier New” for anything I would
type into the document, the font of the text itself is “Liberation Serif”
If I change the
Le 22/04/2021 à 22:17, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
My system could not find DejaVuSans,
You can find it in
C:\lazarus\fpc\3.2.0\source\packages\fcl-report\demos\fonts.
May be you don't need to install the font, just add on the line below
where you
Le 23/04/2021 à 11:08, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
Now if I type new text in the ODT document, it’s Consolas, but the
actual text in the document is still Liberation Serif… and it doesn’t
align, if I select all the text and change it to Consolas it’s
Le 23/04/2021 à 19:56, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
Get Checked or Selected works great, but if I push it twice, the
second time I get:
Unable to open file
C:\Users\James\AppData\Local\Temp\FiC152.odt
But I did make sure to close word and the PDF f
Le 25/04/2021 à 02:54, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
I’ve been trying make “Load from file”happen automatically when the
program starts.. I would like it to happen after configuration.ini
restores the file name and also after the form is on the screen
Le 25/04/2021 à 15:24, James Richters via fpc-pascal a écrit :
RE: [fpc-pascal] Directory Tree
I fixed the time totals to show days correctly with this:
I didn't use your pull request because I don't know yet how to handle it.
I have delete some files which differed only by case. After commit
Le 25/04/2021 à 21:30, James Richters via fpc-pascal a écrit :
>I added LoadFromFile in this event.
That was the first thing I tried, but the problem is, this happens before
anything is put on the screen.. so when I run the program with an Ini file with
4000 entries in it, there is a
Sorry, I didn' had time this week to have a look to your last additions.
Le 01/05/2021 à 15:27, James Richters via fpc-pascal a écrit :
Any ideas how to save and restore the column widths for
VirtualStrinTrees in the ini file?
I imagine it can be done through the events of the IniProperty Stor
Le 01/05/2021 à 15:27, James Richters via fpc-pascal a écrit :
Any ideas how to save and restore the column widths for
VirtualStrinTrees in the ini file?
Done with the events and methods of TIniPropStorage.
___
fpc-pascal maillist - fpc-pascal@lists.
Le 02/05/2021 à 23:42, James Richters via fpc-pascal a écrit :
But I’m thinking I didn’t really define the variable the way it would
normally be done with Lazarus.
Just for notice: classes and objects are not particular to Lazarus, it's
plain Object Pascal, understood by Freepascal and Delphi wh
Le 03/05/2021 à 13:55, James Richters via fpc-pascal a écrit :
>Defining it in public in TText_to_PDF is a good idea.
I tried putting it under the destructor in public… above the private
variables, but it wouldn’t compile thereI thought it would have to be
above all the functions and procedure
I do not guarantee anything, I didn't use this recently, but I have a
function for sending mail with attachments using Synapse.
It's the function MailTo_SMTP in this unit :
https://github.com/jsuzineau/pascal_o_r_mapping/blob/master/pascal_o_r_mapping/3_Data/uMailTo.pas
(my code is under LGPL, y
My code uses others units from this directories:
https://github.com/jsuzineau/pascal_o_r_mapping/tree/master/pascal_o_r_mapping/2_Units
https://github.com/jsuzineau/pascal_o_r_mapping/tree/master/pascal_o_r_mapping/3_Data
Particularly, Formate_Liste from
https://github.com/jsuzineau/pascal_o_r_ma
Le 04/05/2021 à 01:55, James Richters via fpc-pascal a écrit :
I’ve been noticing odd behavior in Lazarus.. if I stop the program and
modify the form, then hit the green arrow… none of my for
modifications are shown.. it’s still using the old form.. but if I use
the pull down menus to build t
I think you could just manage the end of your string with a #0 char.
Just allocate enough space for the maximum size of your string plus the
terminal #0 char.
For example
program Project1;
{$mode objfpc}{$H+}
uses
SysUtils, Classes;
var
s: array[0..30] of char;
p: PChar;
begin
p:
Note: if your string is UTF8 encoded, the last "character" can be
encoded, can span over 1 to 4 "Char", you need to know the length of
your character.
For example:
program Project1;
{$mode objfpc}{$H+}
uses
SysUtils, Classes;
var
s: array[0..30] of char;
p: PChar;
i: Integer;
begin
In Lazarus , in your source code, you can can "Ctrl + Click" on
Registry.ReadString and it will bring you to the declaration of
TRegistry.ReadString in unit Registry. There you will find there are
other methods like ReadInteger, ReadInt64, ReadBinaryData. I'm not sure
which one will best match
Le 16/06/2021 à 00:31, James Richters via fpc-pascal a écrit :
Thanks for the help, it's working fine using readinteger I guess as long as I
don't have any values large enough to need the most significant digit that
would work...
I guess that what was meaning Bart by hardcat is that you need
Le 16/06/2021 à 00:31, James Richters via fpc-pascal a écrit :
In order to change the value I want to change, I need to run my program as
administrator, is there a way to change to administrator with a request from
within the program?
I guess I could make just a small program that changes the
I just add a small program to illustrate the type cast between signed
and unsigned:
var
si: ShortInt;
begin
si:= -127;
WriteLn( 'si ', si);
WriteLn( 'Byte(si) ', Byte(si));
si:= -1;
WriteLn( 'si ', si);
WriteLn( 'Byte(si) ', Byte(si));
end.
gives
$ ./project1
s
My best score is 67 kb after strip -s with the code below ... ;-)
Of course it will not work on every version of Windows.
program uptime;
function GetTickCount64: QWord; stdcall; external 'kernel32.dll';
function _2d( _i: Integer): String;
begin
Str( _i, Result);
if Length(Result) <
10 kb of Powerbasic ... you're cheating, it's pascal here ;-)
You can do this with just 1kb of PowerShell ...
( may be Pascal script could even be shorter ...)
File uptime.ps1 :
$MethodDefinition = @"
[DllImport("kernel32")] public extern static UInt64 GetTickCount64();
"@
$Kernel32 = Add-Type
May be you can get some information with the "route" command .
If you run "route print" in cmd command prompt, you can get information
on the different networks available.
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/route_ws2008
(I couldn't find the doc for
I've never used open vpn, may be the 10.117 is defined in your
configuration file ?
For the vpns I've used, the ip adressed were fixed.
( for route, you can type too something like "route print 10.117.*" )
___
fpc-pascal maillist - fpc-pascal@list
Le 18/06/2021 à 17:07, Bo Berglund via fpc-pascal a écrit :
I will need to check this in my connector class, the address to look for has to
be a config item in my application so it can be modified if need be without
rebuilding the app.
Have to figure out how to:
- Retrieve the output of the TProc
Ooops... little overflow bug
My computer has reached 33 days of uptime today and with
var
t, d, h, m, s: Integer;
you switch to the negative side ...
I got a display like : -8:-4:-52
Replacing with QWord solved the problem (I imagine DWord would just
allow for something like 66 days)
var
1 - 100 of 150 matches
Mail list logo