Results 1 to 5 of 5

Thread: what's wrong here?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Baytown, TX United States
    Posts
    19

    Post

    There's something weird that happens when I run this code:
    Dim curSales as Currency
    curSales = Val(Inputbox("Enter a sales amount"))
    do
    curSales = Val(Inputbox("Enter a sales amount"))
    Print curSales * .1
    Loop Until curSales < = 0

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Ireland
    Posts
    96

    Post

    Apart from the fact that the first entry will not be recorded, what is "WEIRD"?

    Steve.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Baytown, TX United States
    Posts
    19

    Post

    How should I change it so the first entry WILL be recorded?

    ------------------
    kazooie21

  4. #4
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    Post

    just skip the first line before the 'do ...'

  5. #5
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    Post

    if you want to print the curSales at least one time (even if it is negative), then use following code:

    [CODE]
    Dim curSales As Currency

    While curSales <= 0
    curSales = Val(InputBox("Enter a sales amount"))
    Print curSales * 0.1
    Wend
    [\code]

    [This message has been edited by c@lle (edited 11-23-1999).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width