Goto is still used in C. It is a clear and reliable way to exit nested loops. Some people may not like it for readability but it sure clears up a bunch of conditional breaks to exist the nested loops - an immediate jump out with no risk of a partial outer loop being executed along the way, no flags or other code to check on the way out. Simple and fast and actually adds clarity in some complex nested loops."Goto" has not been used in high level languages for more than 30 or 40 years. By tradition in Basic language it is used only to establish the main loop or routine.
PORTx = 1 or PORTx = 0 is not used in the Pic18 series, LATx = 1 or LATx = 0 is used (the pins must be configured as outputs first).
PORTx is used in the Pic18 series as in input or pin reading (x.0 = PORTx.0 or x = PORTx) and the pins must be configured as inputs.
I'm not here to argue the merits of goto, just pointing out that your claim...I'm not going to get into the discussion of "goto" yes or "goto" no. I'm just pointing out the general trend and I totally disagree with you. "goto" has more disadvantages than advantages. I program professionally in C and I don't use it and this is the first time I've heard of someone who uses it (in medium and high level languages).
...is purely incorrect. It is part of a high level language and people do currently use it in specific instances. Kernels for operating systems and embedded systems. The Linux core makes extensive use of goto in C because it's a blazing fast solution to error handling in nested If or nested loops."Goto" has not been used in high level languages for more than 30 or 40 years.
I'm not going to get into the discussion of "goto" yes or "goto" no. I'm just pointing out the general trend and I totally disagree with you. "goto" has more disadvantages than advantages. I program professionally in C and I don't use it and this is the first time I've heard of someone who uses it (in medium and high level languages).
In number #2 I left you your file with some modifications, it may still not do exactly what you want but the RB0 included in the conditional already works, you can continue from there.The source code (Voltmeter.bas) is for a PIC18F2550 MCU.
Triss - Do you mean TRISA, TRISB, etc.?
I am an "amateur" programmer and I do know that many peaple say, that any BASIC dialect and especially using "Goto" is a so called "Spaghetti Code".
For tens of years I have not used any BASIC, Turboscal or Assembler for that matter.
I came back to writing code to fix a PIC18F2550 application because I killed the MCU.
The program was written in mikroBasic by mikroElektronika, but the trial period has long expired.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?