Search found 52 matches

by Phlos
Wed Oct 07, 2015 12:11 am
Forum: Announcement
Topic: PureBasic 5.40 LTS beta 10 is out !
Replies: 213
Views: 93266

Re: PureBasic 5.40 LTS beta 8 is out !

What about using the right forum section for feature requests ? :)
It's already on your "TODO", you told me ... few years ago. So no feature request to add. I'm just disappointed to wait this little stuff since 12 years. :?
I wish I could have access to network library source code, adding this to ...
by Phlos
Mon Oct 05, 2015 10:10 pm
Forum: Announcement
Topic: PureBasic 5.40 LTS beta 10 is out !
Replies: 213
Views: 93266

Re: PureBasic 5.40 LTS beta 8 is out !

One more time, no network library with blocking socket OR asynchronous callback ? :|
We still have to do Delay(100) in main network loop, to prevent stealing whole CPU, in a 2015 language ? :|

****** joke. :|
by Phlos
Thu Sep 04, 2014 2:23 pm
Forum: Coding Questions
Topic: [5.31 beta 1 x86] JSON debug error
Replies: 3
Views: 1993

[5.31 beta 1 x86] JSON debug error

Hello,

Handle = CreateJSON(#PB_Any)
If Handle
If ParseJSON(Handle, "{}")
EndIf
FreeJSON(Handle)
EndIf


When you run this code with debugger, it breaks and says "[ERROR] #JSON object number is very high (over 10000), are You sure of that ?"
Not a big issue, but annoying because it pauses ...
by Phlos
Thu Apr 17, 2014 8:04 pm
Forum: Coding Questions
Topic: [BLOCKING SOCKET] Any ways to wait for network events ?
Replies: 9
Views: 2184

Re: [BLOCKING SOCKET] Any ways to wait for network events ?

Thanks for sharing your code. I already coded my own network library, but I was wondering if there is a 100% PB solution, without calling API from OS. Seems not. :cry:

I can't understand why Fred does not include an option to make blocking socket in official PB network library. Wtf seriously in ...
by Phlos
Wed Apr 16, 2014 11:24 pm
Forum: Coding Questions
Topic: [BLOCKING SOCKET] Any ways to wait for network events ?
Replies: 9
Views: 2184

Re: [BLOCKING SOCKET] Any ways to wait for network events ?

There are no delay()s in the examples. Why do you use them?

As far as code goes, i've only seen serial data transfers use delay() because they don't have a 'listening' layer as networking protocols do - it works more like a timing layer in which delay() is useful. In that sense, properly ...
by Phlos
Wed Apr 16, 2014 8:25 pm
Forum: Coding Questions
Topic: [BLOCKING SOCKET] Any ways to wait for network events ?
Replies: 9
Views: 2184

[BLOCKING SOCKET] Any ways to wait for network events ?

Hello,

Is there a clean and cross platform way to wait for network events without using Delay() in loop (with NetworkClientEvent() or NetworkServerEvent()) and without using all cpu ? :evil:

I run a linux server coded in pure basic, and if I use a Delay(1) in network loop it will use a bit too ...
by Phlos
Thu Jan 30, 2014 9:27 pm
Forum: Coding Questions
Topic: How to resize a gadget when font size can change ?
Replies: 1
Views: 656

How to resize a gadget when font size can change ?

Hello,

I want to know how to resize a gadget to fit it to any Windows font size configuration ?! :?
I tried this kind of code :
If OpenWindow(0, 0, 0, 200, 200, "", #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget)
ComboBoxGadget(1, 0, 0, 100, 100)
AddGadgetItem(1, -1, "String #1 ...
by Phlos
Sat May 19, 2012 2:11 pm
Forum: Coding Questions
Topic: FileSize() bug or feature ?
Replies: 6
Views: 2076

Re: FileSize() bug or feature ?

Yes you are right, it calls FindFirstFile(). But it should not. That's not a reliable behaviour. :cry:
by Phlos
Sat May 19, 2012 1:39 pm
Forum: Coding Questions
Topic: FileSize() bug or feature ?
Replies: 6
Views: 2076

FileSize() bug or feature ?

Hello all,

Look at this simple line of code :

Debug Hex(FileSize("*.jpg"))

If you run it in a directory where it resides some "jpg" picture, it will not returns "-1" error code (file not found), but the size a jpg. :shock: :shock:
Since when the parameter of FileSize() is not a filepath but ...
by Phlos
Sun Mar 09, 2008 4:00 am
Forum: Coding Questions
Topic: Unsigned division ?
Replies: 9
Views: 2077

Thank you Dare & Trond.

You can do any procedure you want (in pure basic or asm), but this is not a good way. It should be fixed in "low level" by Fred... unsigned is a must have for any programming language.

Do you really want to code a big app by that way :

b = $FFFFFFFF
a = (Div(Div(b, 53), 23 ...
by Phlos
Sat Mar 01, 2008 3:15 pm
Forum: Coding Questions
Topic: Unsigned division ?
Replies: 9
Views: 2077

Thank you, I knew for both solution...but the quad is not a solution (if I have the same problem with quad what I do ? :D +very slow with quad !), and the asm one make the source code quite bad to read and implement (the division by 2 was just an easy example, I have a lot of division to do and not ...
by Phlos
Sat Mar 01, 2008 1:26 am
Forum: Coding Questions
Topic: Unsigned division ?
Replies: 9
Views: 2077

Unsigned division ?

Hello,

How can I do a unsigned division with long ?

Code: Select all

Integer.l = $FFFFFFFE
Integer / 2
Debug Hex(Integer)
PureBasic handles only signed value, so it will output -2 / 2 = -1 = $FFFFFFFF
But how can I get the good result ($7FFFFFFF) ?

Thank you.
by Phlos
Sat Oct 27, 2007 3:08 pm
Forum: Coding Questions
Topic: Float bug, how can I quickly fix it please ? :(
Replies: 16
Views: 4312

Dare, I wanted the integer part, so when I want the integer part of 2.7, I will not get the accurate result with your +0.5 trick :P

I repeat for everybody !
When I do this :

Test.f = 1.50
For i = 1 To 5
Test + 0.30
Next i

You agree that Test should be equal to 3.00 right ? (1.50 + (0.30 * 5 ...
by Phlos
Sat Oct 27, 2007 2:03 am
Forum: Coding Questions
Topic: Float bug, how can I quickly fix it please ? :(
Replies: 16
Views: 4312

I am sorry guys, but your fix seems to be wrong :shock:
If I have the float value 2.7 and I want the integer part "2", doing Round(2.7 + 0.5, 0) will return me "3" instead of "2" :shock:

You can't fix the float bad accuracy by adding a constant value :)
by Phlos
Wed Oct 24, 2007 11:21 pm
Forum: Coding Questions
Topic: Float bug, how can I quickly fix it please ? :(
Replies: 16
Views: 4312

I am not a newbie, I knew why it was bugged Psychophanta :wink:

Derek, I cannot use double for 2 reasons :
- my project is big (5000+ lines) and I use float since the beginning (so many many stuffs to change, and maybe new bug :shock: )
- double doesn't really fix the issue, it hides it better :D ...