Make the data in a separate file and add it to Xincludefile. Start entering data from line 11, then you need to subtract 10 to get the number of lines. Click Ctrl+End to move to the end of the data. Look at the number of the last line in which the data is located, subtract 10 and get the number of lines.
In any case, whether you will look for the end of the data or check the “For” cycle counter, the energy spent will be the same.
Check #etx is performed once
Code: Select all
Procedure CountFruits()
Count = 0
Restore FruitList
Repeat
Read.s Fruit$
If Asc(Fruit$) <> #ETX
Count + 1
Else
Break
EndIf
ForEver
ProcedureReturn Count
EndProcedure
DataSection
FruitList:
Data.s "Apple", "Orange"
Data.s "Mango", "Mango"
Data.s #ETX$
EndDataSection
Debug CountFruits()
If you calculate the number of static (stiffly specified) data by transferring in the cycle, then you spend energy useless.
You can store the number of data in a new mark at the end of the data, so you will not have to scroll the code up/down