Search found 1134 matches

by NicTheQuick
Fri Dec 22, 2023 6:06 pm
Forum: Coding Questions
Topic: Mutex : question from a novice
Replies: 5
Views: 633

Re: Mutex : question from a novice

No, you don't need a mutex for a single variable of a native number data type when you only setting static values, because in this case there is always only a single read or write instruction on CPU level. You need a mutex for strings or for 64 bit variables if you compile a 32 bit application, or w...
by NicTheQuick
Wed Dec 20, 2023 4:08 pm
Forum: Linux
Topic: High precision Delay (nano/micro second)
Replies: 15
Views: 1407

Re: High precision Delay (nano/micro second)

NicTheQuick This is exactly what I do. Each time a client is connecting, I create a thread. This thread will handle all data and disconnection event. I added a delay(1) in the main loop because I have a small GUI to display the connection/disconnection and count of online client, so I have to handl...
by NicTheQuick
Wed Dec 20, 2023 2:56 pm
Forum: Linux
Topic: High precision Delay (nano/micro second)
Replies: 15
Views: 1407

Re: High precision Delay (nano/micro second)

What kind of crash do you have with the clients connecting all at once? 250 sounds not that much in my opinion. And what are you doing with the delays on the server side? Why do you not just handle all network events as fast as possible? You may want to give each connection it's own thread where the...
by NicTheQuick
Wed Dec 20, 2023 1:15 pm
Forum: Linux
Topic: High precision Delay (nano/micro second)
Replies: 15
Views: 1407

Re: High precision Delay (nano/micro second)

Regarding the first example: The biggest problem here is the `Delay(0)`. Although it should not make any delay at all, it will force the operating systems scheduler to switch contexts and give room for other processes. You will see a much better result if you straight up remove the `Delay(0)` compl...
by NicTheQuick
Tue Dec 19, 2023 11:27 am
Forum: Bugs - Windows
Topic: [Done] The path established by the PB is UTF8 format
Replies: 9
Views: 829

Re: bug:The path established by the PB is UTF8 format

Can you please make a little more effort with your bug reports? The English is so difficult to understand that it's hard to know what you mean.
by NicTheQuick
Fri Dec 01, 2023 6:09 pm
Forum: Coding Questions
Topic: IF and SELECT condition question ...
Replies: 13
Views: 628

Re: IF and SELECT condition question ...

My original PLC programs are older assembler programs for the MC68000 and MC68HC11E1 microprocessors. As I use a lot of JMP (jump)=GOTO and JSR (Jump to subroutine)=GOSUB commands in these assembler programs, and I like to translate them to PB as close as possible (I know these programs works well)...
by NicTheQuick
Fri Dec 01, 2023 2:48 pm
Forum: Coding Questions
Topic: Regexp Expression
Replies: 29
Views: 1058

Re: Regexp Expression

It's working on my side.
If it does not work on your side, you changed something and you should tell us about that.
by NicTheQuick
Fri Dec 01, 2023 1:38 pm
Forum: Coding Questions
Topic: IF and SELECT condition question ...
Replies: 13
Views: 628

Re: IF and SELECT condition question ...

There is no problems with "If" and a "Goto" inside. However usually there is no reason to use "Goto" at all. There are better ways to do what you want, for example Procedures.
by NicTheQuick
Tue Nov 28, 2023 11:08 am
Forum: Coding Questions
Topic: GetFilepart bug
Replies: 18
Views: 925

Re: GetFilepart bug

On Linux files starting with a dot are treated as hidden files. The name `.config` is basically a file named `config`, but hidden.
by NicTheQuick
Tue Nov 21, 2023 11:44 am
Forum: Coding Questions
Topic: Does WriteFile command still exist ?
Replies: 12
Views: 605

Re: Does WriteFile command still exist ?

I never heard of something like flux.w in the context of Purebasic. But if you search for "flux" in this board you can find a lot of threads. Maybe you have included something you forgot about. Also "texte$" sounds very German because it's the plural of "text".
by NicTheQuick
Tue Nov 21, 2023 11:32 am
Forum: Coding Questions
Topic: Does WriteFile command still exist ?
Replies: 12
Views: 605

Re: Does WriteFile command still exist ?

I am only aware of CreateFile, ReadFile and OpenFile. I never heard of WriteFile. Do you may have some old resident files in your installation?
by NicTheQuick
Fri Nov 17, 2023 2:29 pm
Forum: Coding Questions
Topic: Underscore naming convention
Replies: 13
Views: 713

Re: Underscore naming convention

I am not aware of any convention in Purebasic. Everyone seems to have its own convention. :wink:
Why and on the basis of whose codes do you come to the conclusion that there is a hidden convention?
by NicTheQuick
Wed Nov 15, 2023 2:43 pm
Forum: Coding Questions
Topic: C const. arrays
Replies: 43
Views: 2756

Re: C const. arrays

I don't know if it is good to set a string array the pointers to the string itself, because then there are pointer strings that are not allocated by pb and on exit the release may fail and crash. Sure, there can be a problem with that. I didn't had one yet, at least in the main scope. You will get ...
by NicTheQuick
Wed Nov 15, 2023 1:37 pm
Forum: Coding Questions
Topic: C const. arrays
Replies: 43
Views: 2756

Re: C const. arrays

Usually the Basic way of doing that is to use the Restore keyword: Dim MonthNames.s(11) Restore MonthNames For i = 0 To 11 Read.s MonthNames(i) Debug MonthNames(i) Next DataSection MonthNames: Data.s "January", "February", "March", "April", "May", &q...
by NicTheQuick
Mon Nov 13, 2023 8:36 am
Forum: Off Topic
Topic: Stay Safe Out There
Replies: 6
Views: 1038

Re: Stay Safe Out There

I basically forgot that there are ads in the Google results. I am using ad blockers since 20 years or so. :lol: