QB64.org Forum
Active Forums => Programs => Topic started by: NOVARSEG on February 08, 2021, 01:01:11 am
-
What I got so far
There are bugs for sure. Basic line editor with APPEND, INSERT, DELETE and BACKSPACE
Have to add Backspace yet.
_TITLE " LINE EDITOR Press ESC to exit"
oldcp = 25
cp = 25
' PRINT kh
' END
cp = cp + 1
cp = cp + 1
'left arrow
cp = cp - 1
'right arrow
cp = cp + 1
-
Added Home, Back space, End
_TITLE " LINE EDITOR Press ESC to exit"
oldcp = 25
cp = 25
'PRINT kh
'END
cp = cp - 1
IF kh
= 8 AND cp
= oldcp
THEN GOTO LL1
' To avoid inserting or appending the back space character
cp = cp + 1
cp = cp + 1
LL1:
cp = oldcp
'left arrow
cp = cp - 1
'right arrow
cp = cp + 1
-
Your on you way to remaking GW Basic :)
-
LOL
Trying to get it to work in other screen modes.
-
LOL
Trying to get it to work in other screen modes.
I have that, Steve just posted one, I think (ExtendedInput Sub or Function)?
I'd show mine if you want but more fun to struggle with it yourself, good practice.
In other screens all you have to watch is Locate, it throws error if not inside screen, 2nd problem screen starts scrolling past Printing 2 lines before bottom unless you use Print with ;
Then there are the problems of the line going past the width of screen.
(Just ran your code) Oh man don't test this in full screen until works in regular one is my suggestion.
Hey I thought you were trying SCREEN _NEWIMAGE(yourWidth, yourHeight, 32)?
I don't think the cursor thing is going to work outside SCREEN 0 but I never tried. You could draw a cursor and blink it with graphics if extended LOCATE doesn't work.
-
Ok need a font library that can work with a cursor. The font position and cursor position are independent. Maybe something that duplicates what text mode already has and then scale the size
Did you run the latest code?
-
Yes I ran code of Screen 0 in _FULLSCREEN mode.
For Fonts can you do Fonts in Screen 0? I never tried, maybe through a _Newimage trick.
Screens from _NewImage provide way more flexibility.
-
Just to give you a heads up, when you get to all the bells and whistles, you are looking at a few thousand lines of code. If you are thinking about going the wp route with a working GUI, it's around 6000+. It's fun stuff, but quite a commitment if you have other projects you want to get to.
Pete
-
Yes I ran code of Screen 0 in _FULLSCREEN mode.
For Fonts can you do Fonts in Screen 0? I never tried, maybe through a _Newimage trick.
Screens from _NewImage provide way more flexibility.
Fonts work in Screen 0, as long as they’re monospaced.
-
Thanks but if something is good enough for fonts, I would likely want more flexibility than Screen 0.
-
More flexibility than SCREEN 0? For what? So you can bend over and kiss your ascii goodbye?
Pete
SCREEN 0, because anything else is just a waste of good pixels.
-
Working on a calculator that calculates mortgages etc anyone interested?
HaH you say - what about the online ones???
Good point :)
114 lines of code so far
FULLSCREEN is nice but how do you minimize it?. It takes up the WHOLE screen. It would be nice to have a say, 1024 * 768 pixel screen with big font. Is there a universal screen that does everything? without 6000 lines of code
-
You need to learn the _FONT command.
SCREEN _NEWIMAGE(1024, 768, 32)
_FONT _LOADFONT(“courbd.ttf”, 48, “monospace”
PRINT “Hello World”
SLEEP
SYSTEM
-
When I was 18, I went to bankers, to find out how amortization was calculated. Every loan officer I spoke with had the same answer, we look in this book. Frustrated with these replies, I went home, and started fiddling around with various methods to make a formula to calculate amortization. I had success using geometric progressions. I used the same technique two years later, when I got my T.I. 4A computer. It was correct within one or two pennies of "The Book." That was fun. I might have something similar on some old stored hard drive from a ghosted computer, but these days, I would suspect you can search that algorithm online... unless it returns Buy this book now at ScAmazon.con.
Good luck with it, and you might want to search "calculator" for some ideas already posted to these forums.
Pete
-
I just looked up the forumla:
A=P * ( i(1+i)^n) / ((1+i)^n-1) )
A = periodic payment amount
P = amount of principal, net of initial payments
i = periodic interest rate
n = total number of payments
Look OK?
-
Wow, that brought back a lot of memories of all the scribbles I had over several sheets of cheap brown paper, which lead up to such a formula. That does look very similar, and could be exact, but my memory of over 4 decades ago is a little cloudy. Sorry about that.
Pete
-
@bplus
A = P * i * (1 + i) ^ n / ((1 + i) ^ n - 1) eq 1
where
A = monthly payment
P = amount borrowed !!!
The above equation works but look at this one
mp = i * (A * (1 + i) ^ n - P) / ((1 + i) ^ n - 1) eq2
where mp = monthly payment
A = Amount borrowed
i = interest rate = APR / 12
n = number of monthly payments
P = Principal
Most books on finance and anywhere on the net do not consider the above equation.
Initially, the amount borrowed = Principal. (That is where the confusion comes from) The fact is the Principal gets paid down so the amount borrowed is NOT the same as the Principal. The above equation proves that.
The amount borrowed stays the same
The Principal decreases (to zero usually)
The principal usually decreases to zero as it is paid down. If P = 0 then eq 2 can be written as
mp = i * A * (1 + i) ^ n / ((1 + i) ^ n - 1)