Increment ProgressBar.Position by 0.42

Posted on 2006-05-31
Last Modified: 2011-09-20

I am in a loop and I want to increment ProgressBar.Position by 0.42

But when I am trying to do so as fellow:

ProgressBar.Position := ProgressBar.Position + 0.42;

I am getting [Pascal Error] ... Incompatible types: 'Integer' and 'Extended'

How can I solve this?

Your help would be greatly appreciated.
Question by:AngryC
    LVL 15

    Expert Comment

    Because the values that can be associated with the ProgressBar.Position can only be whole numbers (1,2,3,...)
    LVL 17

    Accepted Solution

    you could set Progressbar1.Max to 10000 instead of 100
    and  do
    progressbar.position := progressbar.position + 42;

    b) you could keep the value i another extended variabnle, update that instead, but only show the rounded value on the progressbar

       realposition: double;

    realposition := 0
    progressbar.position := 0;

    realposition := realposition + 0.42;
    ProgressBar.Position := Round(realposition);  // eg. if realposition was 0.42, progressbar would show 0,if it was 1.26 the progressbar would show 1


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video discusses moving either the default database or any database to a new volume.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now