Author |
Topic: Wishlist of minor editor suggestions (Read 6799 times) |
|
softweir
New Member
member is offline


Posts: 12
|
 |
Re: Wishlist of minor editor suggestions
« Reply #27 on: Nov 10th, 2010, 12:02am » |
|
on Oct 6th, 2010, 08:38am, knudvaneeden wrote:| But inversely, it is probably much easier to find out where a (new) function, procedure or methods *begins*. |
|
I haven't tried this, but I seem to remember that it is possible for a BB4W program to have multiple entry points to a procedure or function. So for example:
Code:PROCprocedure1a()
PROCprocedure1b(7)
PROCprocedure1c("numero",7)
END
DEF PROCprocedure1a()
LOCAL numeral%=0
DEF PROCprocedure1b(numeral%)
LOCAL text$="Number"
DEF PROCprocedure1v(text$,numeral%)
PRINT text$;" ";numeral%
ENDPROC (This is, of course, hideously bad programming practice!)
While PROCprocedure1a is being interpreted, the lines starting DEF PROCprocedure1b and DEF PROCprocedure1c are ignored, and it is interpreted as:
Code:DEF PROCprocedure1a()
LOCAL numeral%=0
LOCAL text$="Number"
PRINT text$;" ";numeral%
ENDPROC Similarly, PROCprocedure1b is interpreted as:
Code:DEF PROCprocedure1b(numeral%)
LOCAL text$="Number"
PRINT text$;" ";numeral%
ENDPROC I don't know if there are any real-world examples of code such as this (and I hope there aren't!) but any such code would seriously confuse a folding editor.
Hum. Perhaps that would be a good argument FOR a hypothetical folding editor?
|
|
Logged
|
|
|
|
Matt
Developer
member is offline


Gender: 
Posts: 210
|
 |
Re: Wishlist of minor editor suggestions
« Reply #28 on: Nov 10th, 2010, 05:17am » |
|
I notice Richard has used this practice in various places in the LIBs. One obvious case is in WINLIB5 where there are 6 DEFs together. However, the difference is that the LOCALs are on the same line as the DEF, therefore eliminating unnecessary multiple/overlapping LOCALs. I wouldn't know if this was good or bad practice, but it obviously works, and works well.
Matt
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Wishlist of minor editor suggestions
« Reply #29 on: Nov 10th, 2010, 08:40am » |
|
on Nov 10th, 2010, 12:02am, softweir wrote:| I don't know if there are any real-world examples of code such as this (and I hope there aren't!) |
|
I use that technique regularly. I don't consider it particularly bad practice. Any BBC BASIC editor would have to cope with it.
Richard.
|
| « Last Edit: Nov 10th, 2010, 08:41am by admin » |
Logged
|
|
|
|
softweir
New Member
member is offline


Posts: 12
|
 |
Re: Wishlist of minor editor suggestions
« Reply #30 on: Nov 11th, 2010, 5:32pm » |
|
Oh dear. I have managed to be unintentionally offensive (for which I apologise) and made myself look foolish.
Still, all this does strongly enforce the point that a BASIC IDE needs to be very flexible regarding the beginnings and ends of code structures, so much so that a hypothetical folding editor seems totally impracticable.
|
|
Logged
|
|
|
|
|