Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: How to force the not operator to return a byte
« Last post by engkin on Today at 11:55:57 pm »
Great information, Winni!!

Are you suggesting a bug in SizeOf or its documentation?
2
General / Re: How to rewrite this type example ?
« Last post by Re-searcher on Today at 11:36:22 pm »
Hey Bart,

Bedankt voor het bezorgen van de link
Ik zie U wel op dat forum.

Hi Bart
{Thanks for sending me for the link
I'll see you on that forum.}

Erik
3
General / Re: How to force the not operator to return a byte
« Last post by winni on Today at 11:35:21 pm »
RTFM!

Siezof returns the size of variables. Simple as well as records.

And if do a sizeof(SomePointer) it return the size of the pointer.

That's why it is called sizeof.

Winni
4
General / Re: A combobo with a StringGrid?
« Last post by VTwin on Today at 11:34:25 pm »
Got it.

You can do this with a ComboBox and a StringGrid. Reload the StringGrid when the ComboBox changes.

EDIT: Same as Winni said.
5
General / Re: How to rewrite this type example ?
« Last post by Re-searcher on Today at 11:33:42 pm »
Hi MarkMLl

In the early years when I started working, punched cards was also used.
I have also seen large mainframes with large tape recorders.
Teletype terminals (VT ...)
I had a punched card to register at the factory (time registration)
punched card was also used as a means of payment.
A street organ with a punched card.

Erik
6
Hello GetMem,

thanks for sharing! I'm studying and trying to understand your code right now, especially the data handling between the threads. Two questions:

1. Multithreading
As I understand you add tasks to the task list e.g. within the main thread, the task list is then polled by the TClientThread of the server application. I don't see any protection there when TList.Add is called in order to add a task (E.g. from TfMain.miBroadcastMessageClick via FTCPServer.SendMessage). The task list is accessed in the Execute method of the client thread and first the count property is checked and then in case it is not zero the list is copied to a local TList. That copy sequence is protected in a critical section, but as the list is thread specific, that critical section seems to protect nothing. Or is it just to guarantee a cache flush?
Additionally I wouldn't expect the access to TList.count to be thread safe, but I'm not sure. Can you say something to that data handling concept?


2. Synapse RecvPacket
You use RecvPacket several times, e.g. in TClientThread.RecvMessage (line 685 of uTCPSockets). I'm not sure about the synapse library, but as far as I understand the TCP-protokoll the incoming data is just a byte stream and not bundled in packets. So when you call RecvPacket how can you be sure that what you receive is the complete data and not only half of a message or several messages combined?

Regards~
7
General / Re: A combobo with a StringGrid?
« Last post by winni on Today at 11:32:01 pm »
Hi!

Create a ComboBox with the DataSources of your StringGrid.
If you click on an ComboBox item load the DataSource in your StringGrid.

Winni

PS.: Is it possible to get a beer or are there only tofu drinks?
8
General / Re: A combobo with a StringGrid?
« Last post by Jvan on Today at 11:25:03 pm »
Like this image:
9
General / Re: ShowModal disables form minimise
« Last post by winni on Today at 11:21:57 pm »
Well, I tested it on Linux-gtk/x86_64 (Xubuntu 18,04), so it doesn't seem to be "Windows-only". It might depend on specific versions of some libs, though, so some Linuxen show and other don't show this behaviour.

Okay. Only tested with Suse Tumbleweed and the last gtk2 libs.

And yes: The titlebar and the system menu are job of the Window Manager and not of Lazarus. So there must be some trouble in the interface to the Window Manager.

And the Window Manager where a long time a problem. The height of the Linux Titlebar was a long time only available through some lousy tricks (including mine).

So this is a tricky item. And remember: You can change your Window Manager with Linux on the fly: After that you only have to restart you session.

Oh oh ....

Winni
10
General / Re: How to force the not operator to return a byte
« Last post by engkin on Today at 11:20:40 pm »
SizeOf(NOT SomeValue) equals SizeOf(PtrInt)
that is 4 or 8 bytes

Not correct! Tested with FPC 3.2
Code: Pascal  [Select][+][-]
  1. var
  2.   B: Byte;
  3.   I: Integer;
  4. begin
  5.   I := SizeOf(not B); // = 1!

How about you do the correct test!
Code: Pascal  [Select][+][-]
  1. const
  2.   b=1;
  3.  
  4. begin
  5.   WriteLn(SizeOf(b));
  6.   WriteLn(SizeOf(NOT b));
  7. //OR
  8.   WriteLn(SizeOf(1));
  9.   WriteLn(SizeOf(NOT 1));

Constants, remember? Ordinal constants.

And why
Code: Pascal  [Select][+][-]
  1. $FF xor B
should be treated differently than
Code: Pascal  [Select][+][-]
  1. not B
?

Hopefully you see the reason now.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018