A good programmer can write good code. A great programmer just assumes the task is possible and then tries to work out how.dr beep wrote: ↑Thu Jul 18, 2024 9:55 pmI once had a query in a tool and it needed a recursive search to do the job,Lardo Boffin wrote: ↑Thu Jul 18, 2024 9:20 pm I don’t have much call for recursion in my job (aside from occasional data validation of complex hierarchical structured data in TSQL) so mostly the DEF FN as shown.
An expert said it was not possible but I solved it. Problem was an IF was not possible but I solved it with boolean algebra and an empty string to return,
a bit like the DEF FN on the ZX Spectrum
Recursive functions in BASIC
-
- Posts: 2256
- Joined: Sat Nov 26, 2016 2:42 am
Re: Recursive functions in BASIC
ZX80
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
ZX81 iss 1 (bugged ROM, kludge fix, normal, rebuilt)
TS 1000 iss 3, ZXPand AY and +, ZX8-CCB, ZX-KDLX & ChromaSCART
Tatung 81 + Wespi
TS 1500 & 2000
Spectrum 16k (iss 1 s/n 862)
Spectrum 48ks plus a DIVMMC future and SPECTRA
-
- Posts: 197
- Joined: Tue Sep 05, 2023 11:56 am
Re: Recursive functions in BASIC
indeed, when I worked for a software house we had a well known architect client that had a very complicated drawing revision sequence. To complicate things they wanted to be able to load the drawings into the system in any order. Everyone said it was not possible to effectively re-order things every time a revision was loaded so that the actual latest version in their sequence was showing at the top, but one programmer wrote the most complex single nested SQL query that did just that. Don't think he ever got the recognition he deserved for that.Lardo Boffin wrote: ↑Fri Jul 19, 2024 3:14 pmA good programmer can write good code. A great programmer just assumes the task is possible and then tries to work out how.dr beep wrote: ↑Thu Jul 18, 2024 9:55 pmI once had a query in a tool and it needed a recursive search to do the job,Lardo Boffin wrote: ↑Thu Jul 18, 2024 9:20 pm I don’t have much call for recursion in my job (aside from occasional data validation of complex hierarchical structured data in TSQL) so mostly the DEF FN as shown.
An expert said it was not possible but I solved it. Problem was an IF was not possible but I solved it with boolean algebra and an empty string to return,
a bit like the DEF FN on the ZX Spectrum
Maybe he should work for Viewpoint, as even now only the last revision uploaded is considered current ......
Re: Recursive functions in BASIC
Saomeone says that good programmers were those ones writing only readable and maintainable code.
They are SORT OF right, but sometimes a trick really makes the difference.
The numeric conversion trick is very cool, BTW !
They are SORT OF right, but sometimes a trick really makes the difference.
The numeric conversion trick is very cool, BTW !