Hi Guys
JJ, i don´t know yet how exactly the ranges works on the original lolremez version.
You can give a shot with the attached file or on it´s documentation here:
https://github.com/samhocevar/lolremezAbout Fb itself, i´m finishing to port, but i must confess, this is one of the most painful things i ever saw before. FB inserts tons of useless code during compiling and the code is so bad organized that it´s really really hard to port or even understand the code flow.
For example, to put a simple line on the console, FB code, seems to be easy, fast and reliable, right ? Something at principle, simple as:
' puts (String(Loword(Width)*Hiword(Width)," ")+Chr(10)) 'clear console
puts("_____________________________")
puts(!"Approxomating Polynomial\n")
sh=copy + " [" +str(lower) + " To " + str(upper) + "]"
Ok...but, that´s not true at all. Internally for inserting a simple line, FB does this:
; puts (String(Loword(Width)*Hiword(Width)," ")+Chr(10)) 'clear console
C_call 'msvcrt.puts' {B$ "_____________________________", 0}
C_call 'msvcrt.puts' {B$ "Approximating Polynomial", 0A, 0}
call 'FbRtl32.fb_StrAssign' HValue, 0-1, DValue, 0-1, 0
call 'FbRtl32.fb_StrConcatAssign' HValue, 0-1, {B$ " [", 0}, 4, 0
call 'FbRtl32.fb_DoubleToStr' D$Lower, D$Lower+4
call 'FbRtl32.fb_StrConcatAssign' HValue, 0-1, eax, 0-1, 0
call 'FbRtl32.fb_StrConcatAssign' HValue, 0-1, {B$ " To ", 0}, 5, 0
call 'FbRtl32.fb_DoubleToStr' D$Upper, D$Upper+4
call 'FbRtl32.fb_StrConcatAssign' HValue, 0-1, eax, 0-1, 0
call 'FbRtl32.fb_StrConcatAssign' HValue, 0-1, {B$ "]", 0}, 2, 0
C_call 'msvcrt.puts' D$HValue.pStringData
When, in fact, all of the above code, each function goes on several windows api (msvcrt), instead simply doing it in 2 lines of code (In fact, using only 2 of these apis: sprintf and puts) like this:
[Sz_PolyminalIntro: B$ "_____________________________
Approximating Polynomial
%s [%.16g To %.16g]", 0]
[Sz_OutputStrBuff: B$ 0 #512]
C_call 'msvcrt.sprintf' Sz_OutputStrBuff, Sz_PolyminalIntro, D$DValue.pStringData, D$Lower, D$Lower+4, D$Upper, D$Upper+4
C_call 'msvcrt.puts' Sz_OutputStrBuff
Again, the whole idea is not bad, but the internal organization is terrible. On the other hand, BCX for example was used to produce a way cleaner code. (Don´t know how is it doing right now, because didn´t had time o test, but as far i remember, BCX was way more robust then FB - at least in terms of internal organization)
Anyway..i´ll continue to port this, and will try to finish today or tomorrow. Keep in mind, that, if FB did that mess on a single string outputted to a console, you may get an idea of what a hell i´m trying to fix on the rest of the code
