I don't know how inefficient or bad this is, but my tests are passing. There's probably many other better ways, but the original quad value is never converted to a double in this case.
Procedure.s FormatCents(value.q, decimals.i = 2, point.c = '.', separator.c = ',')
If (value = 0)
; no need ...
Search found 381 matches
- Sat Oct 28, 2023 7:05 pm
- Forum: Coding Questions
- Topic: FormatNumber() with integers, and with cents implied
- Replies: 10
- Views: 1267
- Wed May 24, 2023 9:46 pm
- Forum: Coding Questions
- Topic: another noob question - image sizes
- Replies: 6
- Views: 1000
Re: another noob question - image sizes
Indeed, it might be the resolution scaling in that casenamrepus wrote: Wed May 24, 2023 12:48 pm ok...
My bad.
Evidently it was something specific to my laptop at home as the computer at works shows everything as expected.
thanks for the help everyone.
I have another fun mystery![]()
- Tue May 23, 2023 7:58 am
- Forum: Coding Questions
- Topic: another noob question - image sizes
- Replies: 6
- Views: 1000
Re: another noob question - image sizes
Do you have resolution scaling set to i.e. 125% or 150%? You can try with the scaled sizes:
#SIZEXY = 400
If OpenWindow(0, 0, 0, #SIZEXY, #SIZEXY, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered|#PB_Window_SizeGadget)
scaledX = DesktopScaledX(#SIZEXY)
scaledY ...
#SIZEXY = 400
If OpenWindow(0, 0, 0, #SIZEXY, #SIZEXY, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered|#PB_Window_SizeGadget)
scaledX = DesktopScaledX(#SIZEXY)
scaledY ...
- Sun May 21, 2023 5:58 pm
- Forum: General Discussion
- Topic: PureBasic Code
- Replies: 12
- Views: 2755
Re: PureBasic Code
It was announced here: https://www.purebasic.fr/english/viewtopic.php?t=77366
Interesting, I see that someone took code from my CodePen and merged it into Prism.js
-> https://github.com/PrismJS/prism/blob/master/components/prism-purebasic.js
Comes from https://codepen.io/ImagineProgramming ...
- Fri May 19, 2023 5:43 pm
- Forum: Coding Questions
- Topic: InsertJSONStructure Property Name Translation
- Replies: 2
- Views: 493
Re: InsertJSONStructure Property Name Translation
Thank you, that confirms what I assumed.
- Fri May 19, 2023 11:26 am
- Forum: Coding Questions
- Topic: InsertJSONStructure Property Name Translation
- Replies: 2
- Views: 493
InsertJSONStructure Property Name Translation
Hi there,
This question is out of pure curiosity, however I've been wondering about methods for automatically translating property names to a different case. I would like to be able to name structure fields with the pascal case convention, but json properties with the snake case convention. If you ...
This question is out of pure curiosity, however I've been wondering about methods for automatically translating property names to a different case. I would like to be able to name structure fields with the pascal case convention, but json properties with the snake case convention. If you ...
- Tue May 02, 2023 10:45 pm
- Forum: Coding Questions
- Topic: Lua using a PB dll?
- Replies: 10
- Views: 1601
Re: Lua using a PB dll?
Good to hear!jassing wrote: Tue May 02, 2023 10:40 pm Not entirely true - you can use an ordinary dll in lua.
It's all solved; working perfectly...

- Tue May 02, 2023 10:25 am
- Forum: Coding Questions
- Topic: Lua using a PB dll?
- Replies: 10
- Views: 1601
Re: Lua using a PB dll?
I wouldn't say a pain, when you choose Lua you always have to align your requirements with the environment you're in.
So yes, a bit of effort depending on the situation :D
I expect effort; but it's how much I'm willing to put in to add something to a program -- My goal was to permit the user ...
- Mon May 01, 2023 5:59 pm
- Forum: Coding Questions
- Topic: Lua using a PB dll?
- Replies: 10
- Views: 1601
Re: Lua using a PB dll?
It really depends actually. if you're using LuaJIT, there's functionality built in. I've called DLLs using it before. http://luajit.org/ext_ffi.html
It's not a third-party module. The page says:
The FFI library is tightly integrated into LuaJIT (it's not available as a separate module).
If you ...
- Sun Apr 30, 2023 3:18 pm
- Forum: Coding Questions
- Topic: Lua using a PB dll?
- Replies: 10
- Views: 1601
Re: Lua using a PB dll?
Hi Jassing,
What are you attempting to do? Do you want to create a Lua module, or do you merely want to invoke a DLL from Lua?
If you want to do the first, the functions invoked by loadlib should;
- Use the CDECL calling convention (i.e. ProcedureCDLL)
- Return an 32-bit int (PB's .l) describing ...
What are you attempting to do? Do you want to create a Lua module, or do you merely want to invoke a DLL from Lua?
If you want to do the first, the functions invoked by loadlib should;
- Use the CDECL calling convention (i.e. ProcedureCDLL)
- Return an 32-bit int (PB's .l) describing ...
- Sat Jul 09, 2022 9:51 am
- Forum: Announcement
- Topic: QoiImagePlugin
- Replies: 3
- Views: 1786
Re: QoiImagePlugin
That's nice :D I personally wanted an integrated solution so that I could use the PureBasic libraries as they are.
Ah I see you implemented that as well, cool. You could ask the creater of the format to enlist your implementation on the reference repo as well :)
P.S. Why not make your own ...
Ah I see you implemented that as well, cool. You could ask the creater of the format to enlist your implementation on the reference repo as well :)
P.S. Why not make your own ...
- Mon Jun 06, 2022 11:12 am
- Forum: Announcement
- Topic: QoiImagePlugin
- Replies: 3
- Views: 1786
QoiImagePlugin
Hi folks,
I created a pure-PureBasic implementation of the Qoi image format based on the specification and reference encoder/decoder.
It is an include-only solution and can be found in QoiImagePlugin.pbi here: https://github.com/Imagine-Programming/QoiImagePlugin
It's far from optimized yet ...
I created a pure-PureBasic implementation of the Qoi image format based on the specification and reference encoder/decoder.
It is an include-only solution and can be found in QoiImagePlugin.pbi here: https://github.com/Imagine-Programming/QoiImagePlugin
It's far from optimized yet ...
- Fri Apr 01, 2022 11:01 pm
- Forum: Coding Questions
- Topic: Delay() inside "While ProgramRunning..."-Loop?
- Replies: 4
- Views: 957
Re: Delay() inside "While ProgramRunning..."-Loop?
Is that not only true for Windows?NicTheQuick wrote: Fri Apr 01, 2022 7:44 pm It instructs the scheduler of your operating system to use the CPU for an other thread/process until the scheduler decides to give your thread attention again.
- Thu Jun 10, 2021 9:01 am
- Forum: Coding Questions
- Topic: Mouse hook misses first event after a key press
- Replies: 4
- Views: 1098
Re: Mouse hook misses first event after a key press
I can't seem to reproduce this in x64 PureBasic 5.72,
where are you clicking when this seems to happen?
Maybe another application is not calling the next hook in the chain in certain situations.
where are you clicking when this seems to happen?
Maybe another application is not calling the next hook in the chain in certain situations.
- Mon Mar 15, 2021 1:31 pm
- Forum: Tricks 'n' Tips
- Topic: Simple CRC64 Routine
- Replies: 13
- Views: 8095
Re: Simple CRC64 Routine
Hi,
this doesn't work for the current PB Version.
Really need crc64 - fast for string and file.
Can you help?
thanks
Try it now, I merely moved the datasection outside of the procedure;
Procedure.q CRC64Fingerprint(*Buffer, Size, InitialValue.q = 0)
CompilerIf #PB_Compiler_Processor = #PB ...
this doesn't work for the current PB Version.
Really need crc64 - fast for string and file.
Can you help?
thanks
Try it now, I merely moved the datasection outside of the procedure;
Procedure.q CRC64Fingerprint(*Buffer, Size, InitialValue.q = 0)
CompilerIf #PB_Compiler_Processor = #PB ...