Hey vovchik
That was fast converting all that c code into BaCon!!
I am trying to follow what you did so I can figure out whats going on between c code and Bacon coding
these are some notes and questions I have
since this is a major move ahead to port to BaCon a heavily commented
first draft version is very welcomed
1.) the original code
scale2png.c was small but not well commented at all so an abstract math equation for me because of not having a known value for
w and
h and other values
which makes the logical part of the
rx and
ry obscure
*I like how you made the variables clearer to read
I dont understand the less than or equal to in the ELSE
IF r_x<=r_y
I would hope for a check for less than --- then a condition
or an equal to --- then a condition
for debugging to see what value you get
I like how you did this part could you add (for debugging verbose )
---------------------------------------------------
' -----------
SUB REPORT_RESULTS()
' -----------
IF FILEEXISTS(new_file$) THEN
PRINT "File ", new_file$, " created."
PRINT "Original image: ", org_file$
PRINT "New dimensions (w x h): ", new_width$, " x ", new_height$
PRINT "Quality of new image: ", quality$
PRINT "Verbose debugging info below "
PRINT "r_x =:",r_x$
PRINT "r_y =:",r_y$
PRINT "h =:",h$
PRINT "y =:",y$
PRINT "q =:",q$
PRINT "q2 =:",q2$
PRINT "new_quality =:",new-quality$
PRINT "new_q =:",new_q$
PRINT "t_height =:",t_height$
PRINT "t_width =:",t_width$
ELSE
PRINT "OOPS.. something terrible happened and ", new_file$, " was not created."
END IF
gtk_exit(0)
END SUB
---------------------------------------------------
3.) the IMPORTS need to be explained well commented how that was done
4.) what is very interesting is how the c part
of the code changes very little in the conversion except for the complex import part
thanks for all your work on this I will learn a lot from it
*maybe another simple c code example with imports( for one trying to learn)
then ported to BaCon
Joe