| |

VerySource

 Forgot password?
 Register
Search
View: 1049|Reply: 5

A question about the CHOOSE statement

[Copy link]

2

Threads

12

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-11 09:00:01
| Show all posts |Read mode
There are 2 values: inventory quantity value (num) and out-of-stock quantity value (outnum). Different operations are performed according to the difference between the two data. The statement is as follows:
a = num-outnum

choose case a
case 0
             // perform all out of stock and delete entries in the inventory table
        case num
            // Prompt for data input greater than 0
        case> 0
            // Exit the warehouse normally, and update the entries in the inventory table
        case <0
           // Prompt input data cannot be greater than total inventory
end choose

This statement always prompts a syntax error during execution, please advise.
Reply

Use magic Report

0

Threads

100

Posts

53.00

Credits

Newbie

Rank: 1

Credits
53.00

 China

Post time: 2020-6-4 18:45:01
| Show all posts
a=num-outnum

choose case a
case 0
// Carry out all the warehouses and delete the entries in the inventory table
case num //It seems that only constants can be used
// Prompt input data must be greater than 0
case is> 0
// Normally leave the warehouse and update the entries in the inventory table
case is <0
// Prompt the input data can not be greater than the total inventory
end choose
Reply

Use magic Report

0

Threads

100

Posts

53.00

Credits

Newbie

Rank: 1

Credits
53.00

 China

Post time: 2020-6-4 22:15:01
| Show all posts
case num //It seems that only constants can be used
// Prompt input data must be greater than 0
------------- You can try this line and forget it.
Reply

Use magic Report

2

Threads

12

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-6 12:00:02
| Show all posts
Thanks, according to your post has been done
Reply

Use magic Report

2

Threads

12

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-6-6 12:45:01
| Show all posts
May use variables, I just tried
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-6-6 16:15:01
| Show all posts
case is> 0
//
No, you can judge in front and then give straight a
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list