Re: [Lazarus] LCL_FULLVERSION is not recognized

2018-07-12 Thread Rik van Kekem via Lazarus

On 12-07-2018 12:51, frans via Lazarus wrote:

I use Lazarus 1.6.4 (temporarely) and lazarus 1.8.4 on Windows 10.
I need to use the LCL version but I can't get it to work properly.
I use the following code:
  {$IFDEF LCL_FULLVERSION > 108}
  {$ELSE}
  {$ENDIF}
Compiling the program give me the message Warning include environment 
"LCL_FULLVERSION" not found in environment. But this is the way I 
fount on the lazarus forum.
What am I doing wrong? And where can I find a list of all Lazarus 
environment variables?



Where did you find this on the forum?
Because you shouldn't use {$IFDEF } but {$IF } (because you are using an 
expression)


So:
{$IF LCL_FULLVERSION > 108}
{$ELSE}
{$ENDIF}

If you use {$IFDEF it will check if "LCL_FULLVERSION > 108" is 
defined, which it isn't.


Also see http://www.math.uni-leipzig.de/pool/tuts/FreePascal/prog/node4.html

B.T.W. You need to include "uses lclversion" because LCL_FULLVERSION is 
declared there (otherwise you get a ansistring error message).


Some other constants: 
http://lazarus-ccr.sourceforge.net/docs/lcl/lclversion/index-2.html


Grtz,
Rik

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Unknown error codes.

2018-05-01 Thread Rik van Kekem via Lazarus

On 29-04-2018 23:55, Carlos E. R. via Lazarus wrote:

It does not list the error 26 I got.
It is possible that there are different numbers on different operating
systems? That list seems to be related to Windows, but the link does not
say.


It's always possible to get the text of an OS error via SysErrorMessage().

Also note that the EInOutError codes in the range 0-99 represent OS 
error conditions, which are different for Windows and Linux. At least in 
Delphi they do.


On Linux Showmessage(SysErrorMessage(26)) gives us:
Text (code segment) file busy

On Windows it gives:
The specified disk or diskette cannot be accessed.

Of course a program can generate an runtime error itself via Error(Code) 
in which case the code didn't come from the OS and it might mean 
something different.


Small test-program will give you a list:
var
  I: Integer;
begin
  for I := 0 to 99 do
  begin
    Memo1.Lines.Add(Format('%d - %s', [I, SysErrorMessage(I)]));
  end;

On Windows it gives:
0 - The operation completed successfully.
1 - Incorrect function.
2 - The system cannot find the file specified.
3 - The system cannot find the path specified.
4 - The system cannot open the file.
5 - Access is denied.
6 - The handle is invalid.
7 - The storage control blocks were destroyed.
8 - Not enough storage is available to process this command.
9 - The storage control block address is invalid.
10 - The environment is incorrect.
11 - An attempt was made to load a program with an incorrect format.
12 - The access code is invalid.
13 - The data is invalid.
14 - Not enough storage is available to complete this operation.
15 - The system cannot find the drive specified.
16 - The directory cannot be removed.
17 - The system cannot move the file to a different disk drive.
18 - There are no more files.
19 - The media is write protected.
20 - The system cannot find the device specified.
21 - The device is not ready.
22 - The device does not recognize the command.
23 - Data error (cyclic redundancy check).
24 - The program issued a command but the command length is incorrect.
25 - The drive cannot locate a specific area or track on the disk.
26 - The specified disk or diskette cannot be accessed.
27 - The drive cannot find the sector requested.
28 - The printer is out of paper.
29 - The system cannot write to the specified device.
30 - The system cannot read from the specified device.
31 - A device attached to the system is not functioning.
32 - The process cannot access the file because it is being used by 
another process.
33 - The process cannot access the file because another process has 
locked a portion of the file.

34 -
35 -
36 - Too many files opened for sharing.
37 -
38 - Reached the end of the file.
39 - The disk is full.
40 -
41 -
42 -
43 -
44 -
45 -
46 -
47 -
48 -
49 -
50 - The request is not supported.
51 - Windows cannot find the network path. Verify that the network path 
is correct and the destination computer is not busy or turned off. If 
Windows still cannot find the network path, contact your network 
administrator.
52 - You were not connected because a duplicate name exists on the 
network. If joining a domain, go to System in Control Panel to change 
the computer name and try again. If joining a workgroup, choose another 
workgroup name.

53 - The network path was not found.
54 - The network is busy.
55 - The specified network resource or device is no longer available.
56 - The network BIOS command limit has been reached.
57 - A network adapter hardware error occurred.
58 - The specified server cannot perform the requested operation.
59 - An unexpected network error occurred.
60 - The remote adapter is not compatible.
61 - The printer queue is full.
62 - Space to store the file waiting to be printed is not available on 
the server.

63 - Your file waiting to be printed was deleted.
64 - The specified network name is no longer available.
65 - Network access is denied.
66 - The network resource type is not correct.
67 - The network name cannot be found.
68 - The name limit for the local computer network adapter card was 
exceeded.

69 - The network BIOS session limit was exceeded.
70 - The remote server has been paused or is in the process of being 
started.
71 - No more connections can be made to this remote computer at this 
time because there are already as many connections as the computer can 
accept.

72 - The specified printer or disk device has been paused.
73 -
74 -
75 -
76 -
77 -
78 -
79 -
80 - The file exists.
81 -
82 - The directory or file cannot be created.
83 - Fail on INT 24.
84 - Storage to process this request is not available.
85 - The local device name is already in use.
86 - The specified network password is not correct.
87 - The parameter is incorrect.
88 - A write fault occurred on the network.
89 - The system cannot start another process at this time.
90 -
91 -
92 -
93 -
94 -
95 -
96 -
97 -
98 -
99 -

On Linux it gives:
0 - Success
1 - Operation not permitted
2 - No such file or directory
3 - No 

Re: [Lazarus] A fix for an annoying problem on Linux

2018-04-03 Thread Rik van Kekem via Lazarus

Op 03-04-2018 15:40 schreef wkitty42--- via Lazarus:

On 04/02/2018 09:51 AM, Anthony Walter via Lazarus wrote:

Here you go ...



what did you change? i see the code you added but i do not see any 
difference in the pictures you posted...


It's a very (very) subtle difference...

It will add the focus-line at the top and bottom within the edit.
(in this case in red but depends on color-scheme)

Rik
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SQLdb_Tutorial3 error

2018-03-13 Thread Rik van Kekem via Lazarus

Op 13-03-2018 12:22 schreef Santiago A. via Lazarus:

Thanks. Finally it works. I created the table employee and set the full
path of the file.

Nevertheless, it looks that sqlite3 is a little... well... sending
SIGSEGV is not a valid error, "cant' find file", "table doesn't exits"
etc would be much better.

I would like to dig a little and try to improve error detection. Is
there any way I can debug into open?. I've tried compiling Lazarus IDE
with debug, but skips over "open" call. What should I compile in debug
mode to parse FQuery.open?
I take it you already activated the debugging options (which were 
disabled in your published project). Otherwise you wouldn't even be able 
to trace to the Open line.


Next problem is that the database sources are not part of the Lazarus 
IDE. They are from FPC. So you would need to recompile the complete FPC 
to be able to step through it. (Recompiling Lazarus IDE only compiles 
the IDE part with debugging information)


I use the trunk version from my own script but you could use fpcupdeluxe 
to install a development version, in which you could trace through the 
whole source. http://wiki.freepascal.org/fpcupdeluxe


Here, I get the correct and expected warnings/errors when using the 
SQLite3 driver (in both Lazarus 1.9 and 1.8.2). SQLite will 
automatically create an empty database if it does not exist. After that 
it should warn about the absence of the employee table.


--
Rik
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SQLdb_Tutorial3 error

2018-03-13 Thread Rik van Kekem via Lazarus

Op 13-03-2018 10:43 schreef Santiago A. via Lazarus:

My point is if I'm missing some package, or the dll should be in other
path, or a hint how to dig and debug deeper, beacuse I can't debug into
open.

No, the SQLite3.dll and your DB should be sufficient.

Could you include your .ini file and your SQLite db?

Normally the firebird employee database is in
C:\Program Files\Firebird\Firebird_2_5\examples\empbuild\EMPLOYEE.FDB
(which you can copy to another location so you can access it)

But for SQLite you'll need to create your own DB with the correct table 
and content.


Rik
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] SQLdb_Tutorial3 error

2018-03-12 Thread Rik van Kekem via Lazarus

Op 08-03-2018 16:07 schreef Santiago A. via Lazarus:

sqlite3.dll is in the same directory that the binary. I have created the
table employee, just in case. I don't know what else to check.  I can't
debug anything else, the debug can't enter in "open" method.


Creating the database and table employee wasn't "just in case".
It was a requirement if you want to use that example with sqlite.
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial3#Getting_database_data_into_normal_controls

And surely you changed something (like the .ini) otherwise you end up 
with Firebird db connection.


So zipping your project (with the database) is still best.

Tip: You are sure sqlite3.dll has the same 'bitness' (i.e. 32 of 64 bit) 
as your executable?


Rik
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Object inspector bug - exception

2018-03-08 Thread Rik van Kekem via Lazarus

On 06/03/18 17:12, Rik van Kekem via Lazarus wrote:

 > Can someone file a bugreport please.
 > I am unable to do so ATM.

Done.
https://bugs.freepascal.org/view.php?id=33344

The exception is fixed in trunk.

But I was under the impression that using TAB in the Component-filter in 
Object Inspector would set the focus on the TreeView with the 
components. It doesn't. I never use it but apparently it sets the focus 
directly on the Property view.


Is this the proper behavior (it was always this way) or is it supposed 
to go to the treeview?


Again, I never use the keyboard there so maybe it's supposed to be that 
way. In Delphi you can "Tab" into the Component Treeview but it hasn't a 
Component-filter-edit.


Rik
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus