Search found 971 matches

by Shield
Wed Sep 25, 2019 6:02 am
Forum: Coding Questions
Topic: Do Constants help speed up your Program ?
Replies: 15
Views: 1954

Re: Do Constants help speed up your Program ?

There's no difference between using a constant and using the literal value. PB literally replaces all constants with their values wherever they occur. However, using constants for Gadgets instead of #PB_Any will waste space if you leave gaps between the IDs. For example, if you create a gadget with ...
by Shield
Tue Apr 02, 2019 5:48 am
Forum: Announcement
Topic: Happy Birthday, Fred!
Replies: 18
Views: 5462

Re: Happy Birthday, Fred!

This ought to be the 15th topic giving a chance to say happy birthday to Fred since I started using PB. Time flies... :o

Happy birthday!
by Shield
Wed Nov 07, 2018 1:05 pm
Forum: General Discussion
Topic: Need help about future decision of my PB apps
Replies: 18
Views: 3298

Re: Need help about future decision of my PB apps

From a business perspective, I'd recommend to move on to another language that enjoys a wider community and more support. While PB has it's advantages (hence I still frequently use it for prototyping), it's a niche language with little support and a very small ecosystem (comparatively). However, if ...
by Shield
Thu Apr 05, 2018 5:04 pm
Forum: Bugs - Mac OSX
Topic: Float/double division by 0 causes invalid memory access
Replies: 4
Views: 2057

Re: Float/double division by 0 causes invalid memory access

@PedroMartins:
This was just an oversight on my part. I tested with floats first and then doubles but forgot to switch StrF().
It's not working either way.

@Wolfram:
Division by zero is perfectly valid and well-defined with floating point data types,
so that's not the issue here either.

@Josh:
Yep.
by Shield
Wed Apr 04, 2018 2:38 pm
Forum: Bugs - Mac OSX
Topic: Float/double division by 0 causes invalid memory access
Replies: 4
Views: 2057

Float/double division by 0 causes invalid memory access

Hi Dividing a float constant by a float variable (or double) that happens to be 0 causes an invalid memory access. If the left hand operand is a variable as well, the result is +Infinity as expected. This seems to be related to the debugger as the correct result is shown in release mode. Define x.d ...
by Shield
Sun Apr 01, 2018 5:39 pm
Forum: Mac OSX
Topic: StartDrawing(): The specified output is NULL (0 value)
Replies: 6
Views: 2346

Re: StartDrawing(): The specified output is NULL (0 value)

Alright, weird... :?

Really looks to me as if there is something asynchronous going on.
A Delay(200) just before the main loop seems to prevent the issue from occurring...
by Shield
Sun Apr 01, 2018 5:36 pm
Forum: Mac OSX
Topic: StartDrawing(): The specified output is NULL (0 value)
Replies: 6
Views: 2346

Re: StartDrawing(): The specified output is NULL (0 value)

@mk-soft Your code from your first answer seems to work, however, when I remove the timer bit and change it to the following it starts crashing occasionally as well. Could there some asynchronous initialization be going on behind the scenes where ScreenOutput sometimes gets called before everything ...
by Shield
Sun Apr 01, 2018 1:11 pm
Forum: Mac OSX
Topic: StartDrawing(): The specified output is NULL (0 value)
Replies: 6
Views: 2346

Re: StartDrawing(): The specified output is NULL (0 value)

The lines beginning with Debug will only compiled if the debugger is turned on. Yes, I know. :) I did that to check whether any of the Init/Open commands fail, they don't and they never do. What I'm saying is: the code above works sometimes and sometimes doesn't, completely randomly, and I have no ...
by Shield
Fri Mar 30, 2018 12:25 pm
Forum: Mac OSX
Topic: StartDrawing(): The specified output is NULL (0 value)
Replies: 6
Views: 2346

StartDrawing(): The specified output is NULL (0 value)

Hey :) I have to use OSX for work and wanted to see how well PB works on it. Was off to a great start, but I soon encountered a problem I have no solution for: StartDrawing(): The specified output is NULL (0 value). Debug InitSprite() Debug OpenWindow(0, 0, 0, 800, 600, "") Debug OpenWindo...
by Shield
Thu Mar 22, 2018 6:04 pm
Forum: Coding Questions
Topic: Compilation problem!
Replies: 6
Views: 1194

Re: Compilation problem!

Might be a unicode / ASCII problem, but it's hard to say. You really have to provide some source code example that reproduces the problem.
by Shield
Sat Feb 10, 2018 1:37 am
Forum: Feature Requests and Wishlists
Topic: New command "IsMemoryID(*memoryID)
Replies: 21
Views: 4305

Re: New command "IsMemoryID(*memoryID)

a IsMemoryID() function to check if a memory ID is still valid A memory ID is just a pointer to a given address in RAM. It's always going to be valid, even if that memory is freed. While this is true that the pointer is still valid (since it is just a regular integer variable), dereferencing (i.e. ...
by Shield
Thu Jan 25, 2018 9:23 am
Forum: Off Topic
Topic: Firefox Quantum - oh, the speed!
Replies: 20
Views: 4423

Re: Firefox Quantum - oh, the speed!

AFAIK, the reason why the new Firefox feels faster hasn't much to do with JavaScript performance but more with its CSS rendering engine that's now multi-threaded (thanks to the Servo project and the Rust programming language). Browser vendors tried to parallelize this before but failed (Mozilla fail...
by Shield
Thu Dec 14, 2017 1:55 pm
Forum: Feature Requests and Wishlists
Topic: Improved line continuation
Replies: 29
Views: 9274

Re: Improved line continuation

Limiting lines to 80 characters (not 60) is actually really common and has little to do with screen size but with readability. Reading code that has excessively long lines is a nightmare. @Mistrel Alright, I get now what you mean. It's still a terrible idea in my opinion. @Josh Yes, what we have now...
by Shield
Wed Dec 13, 2017 5:29 am
Forum: Feature Requests and Wishlists
Topic: Improved line continuation
Replies: 29
Views: 9274

Re: Improved line continuation

It wouldn't work, because the compiler would have to treat anything after a semicolon (i.e. comment) as a continuation, so it would inevitably break all code.

Code: Select all

If a ;
    Debug a
EndIf
Would have to be treated as

Code: Select all

If a Debug a
EndIf
by Shield
Wed Nov 15, 2017 9:00 am
Forum: Coding Questions
Topic: Prototype.l (return a long) don't work
Replies: 10
Views: 2711

Re: Prototype.l (return a long) don't work

You can mask it. Procedure.l test() ProcedureReturn $FFFFFFFF ; = 4294967295 EndProcedure a.q = test() & $FFFFFFFF Debug a Edit: Not sure I get what you mean. If the command returns a signed 4 byte integer, which it seems it does, then 4294967295 is equal to -1 because of how they wrap, so you d...