|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#14
|
||||||
|
||||||
|
Using 254-x Max 254 is better, but it can still cause errors. For example, if x=255, then 254-x will evaluate to -1, which in PBASIC is approx 65,000. You then take the max and get 255. While this will prevent basic run errors, it can still cause run-time logic problems.
While it's not likely that x will be 255, its still a possibility I don't like leaving. Therefore, I would reccomend the following code: x=2254-x Min 2000 Max 2254 - 2000 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Victor problem | Andy Baker | Electrical | 15 | 24-06-2003 09:49 |
| multi-bank programming problem | GregC | Programming | 3 | 14-02-2003 16:13 |
| The problem with scouting... | archiver | 2001 | 10 | 23-06-2002 23:49 |
| Major problem with chipphua motors | aka Scott White | Motors | 18 | 19-03-2002 19:44 |
| Error found in programming for the pump and pressure switch | sjharobotics | Programming | 4 | 06-02-2002 17:46 |