Search found 9 matches

by AlfaRomeo
Fri Dec 19, 2025 11:48 am
Forum: Coding Questions
Topic: Loops in floats
Replies: 7
Views: 560

Re: Loops in floats

With the code:

Define ia.i, a.d
For ia = 100 To 5000 Step 4 : a = ia / 100.0
; code with "a"
Next

it worked like a charm :)

Thank you all
by AlfaRomeo
Thu Dec 18, 2025 2:49 pm
Forum: Coding Questions
Topic: Loops in floats
Replies: 7
Views: 560

Loops in floats

Hi, I want to convert a routine from QB64 to PureBasic but it includes a loop with a STEP in floating point..
How I could convert this:

Code: Select all

FOR a = 0 TO 50 STEP .04
...
code
...
NEXT
Thanks in advance
by AlfaRomeo
Sun Jun 30, 2019 12:19 pm
Forum: Coding Questions
Topic: Display an animation inside a system window
Replies: 6
Views: 1311

Re: Display an animation inside a system window

Thanks for the replies, I will try to implement your suggestions in my code and see if it will works.
I'm new in PureBasic and there is much I didn´t figured yet about how it works :?
by AlfaRomeo
Sun Jun 30, 2019 11:07 am
Forum: Coding Questions
Topic: Display an animation inside a system window
Replies: 6
Views: 1311

Re: Display an animation inside a system window

Are you using threads? Because that can cause your errors to be shown on a different seemingly unrelated line of code.

Yes, I use a thread

Procedure GetSprites(bat1,bat2,bat3,bat4)

UsePNGImageDecoder()
UseJPEGImageDecoder()
battery=LoadSprite(#PB_Any,"D:\Store\New\Images\battery_strip.jpg ...
by AlfaRomeo
Sun Jun 30, 2019 10:45 am
Forum: Coding Questions
Topic: Display an animation inside a system window
Replies: 6
Views: 1311

Display an animation inside a system window

Hello,

It´s possible to display an animation inside a system window with system gadgets?

I tried to make it but when I click in the gadget to start the animation the program give me
the error: The specified #Sprite is not initialised in the code line
Select WaitWindowEvent()
even if I already ...
by AlfaRomeo
Fri Jun 21, 2019 1:21 pm
Forum: Coding Questions
Topic: Update battery values during main loop
Replies: 13
Views: 2350

Re: Update battery values during main loop

RASHAD wrote:Maybe CreateThread() is your good approach
Thanks for the hint RASHAD, it´s a good help :)
by AlfaRomeo
Fri Jun 21, 2019 1:00 pm
Forum: Coding Questions
Topic: Update battery values during main loop
Replies: 13
Views: 2350

Re: Update battery values during main loop

spikey wrote: The call to GetSystemPowerStatus_ needs to be inside the loop to update the values.
You´re right spikey, when I moved the call to GetSystemPowerStatus_ to inside the main loop, the battery values started updating.

Thanks for your help :)
by AlfaRomeo
Fri Jun 21, 2019 12:38 pm
Forum: Coding Questions
Topic: Update battery values during main loop
Replies: 13
Views: 2350

Re: Update battery values during main loop

Many thanks for your fast reply wombats :)

Will try to implement your solution

@spikey

Just a thought but querying the battery status twice every second is probably not the greatest idea if, in fact, you are concerned about battery life...


Thanks for your advise, maybe your right.
Will try ...
by AlfaRomeo
Fri Jun 21, 2019 10:35 am
Forum: Coding Questions
Topic: Update battery values during main loop
Replies: 13
Views: 2350

Update battery values during main loop

Hello,
does anyone knows why the battery values doesn´t are updating during the running time of this program?


If GetSystemPowerStatus_(PowerStatus.SYSTEM_POWER_STATUS)
OpenWindow(0,50,50,256,100,"Battery status",#PB_Window_SystemMenu | #PB_Window_MinimizeGadget)

ACtxt.s=""
batFlagTxt.s ...