Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Finances Utility
#1
It keeps track of balances and transactions for multiple accounts with an ability to search for transactions based on balance, transaction amount, transaction description or date. I find it quite useful
.bas   Finances.bas (Size: 84.9 KB / Downloads: 24) Rolleyes
I went looking for the second and found it in the Renaissance. The mechanical clocks were too new to tick at different moments. The rhythm became permanent. -- ASCIIhole 
Reply
#2
Sleepy
(01-14-2026, 10:15 PM)ASCIIhole Wrote: It keeps track of balances and transactions for multiple accounts with an ability to search for transactions based on balance, transaction amount, transaction description or date. I find it quite useful Rolleyes

Posted this not 2 hours ago and I just found a bug I never noticed. The LongCenter$() FUNCTION doesn't work for short strings. This will fix that: 

Code: (Select All)
[FUNCTION LongCenter$ (Text$, MinCharactersPerLine%, MaxCharactersPerLine%, ScreenWidth%)
IF LEN(Text$) <= MaxCharactersPerLine% THEN Rtrn$ = Text$: GOTO EndOfLongCenterFUNCTION
TryAgain:
OriginalString$ = Text$: NumCharactersOnRemainingLine% = 0: CatchInfiniteLoops% = 0
DO
BeforeCutLocation% = LEN(Text$) - MaxCharactersPerLine%
CutLocation% = BeforeCutLocation%
DO
CutLocation% = CutLocation% + 1
LOOP UNTIL MID$(Text$, CutLocation%, 1) = " "
LastPart$ = MID$(Text$, CutLocation% + 1, LEN(Text$) - (CutLocation% + 1) + 1)
Text$ = MID$(Text$, 1, CutLocation% - 1)
CatchInfiniteLoops% = CatchInfiniteLoops% + 1: IF CatchInfiniteLoops% < 0 THEN MaxCharactersPerLine% = MaxCharactersPerLine% + 1: GOTO TryAgain
LOOP UNTIL LEN(Text$) <= MaxCharactersPerLine%
NumCharactersOnRemainingLine% = LEN(Text$)

CurrentCharactersPerLine% = MaxCharactersPerLine% + 1
DO WHILE NumCharactersOnRemainingLine% < MinCharactersPerLine%
CurrentCharactersPerLine% = CurrentCharactersPerLine% - 1
Text$ = OriginalString$
DO
BeforeCutLocation% = LEN(Text$) - CurrentCharactersPerLine%
CutLocation% = BeforeCutLocation%
DO
CutLocation% = CutLocation% + 1
LOOP UNTIL MID$(Text$, CutLocation%, 1) = " "
LastPart$ = MID$(Text$, CutLocation% + 1, LEN(Text$) - (CutLocation% + 1) + 1)
Text$ = MID$(Text$, 1, CutLocation% - 1)
LOOP UNTIL LEN(Text$) <= CurrentCharactersPerLine%
NumCharactersOnRemainingLine% = LEN(Text$)
CatchInfiniteLoops% = CatchInfiniteLoops% + 1: IF CatchInfiniteLoops% < 0 THEN MaxCharactersPerLine% = MaxCharactersPerLine% + 1: GOTO TryAgain
LOOP

CurrentCharactersPerLine% = CurrentCharactersPerLine% - 1
Text$ = OriginalString$
Rtrn$ = ""
DO
BeforeCutLocation% = LEN(Text$) - CurrentCharactersPerLine%
CutLocation% = BeforeCutLocation%
DO
CutLocation% = CutLocation% + 1
LOOP UNTIL MID$(Text$, CutLocation%, 1) = " "
LastPart$ = MID$(Text$, CutLocation% + 1, LEN(Text$) - (CutLocation% + 1) + 1)
SideSpaces% = INT((ScreenWidth% - LEN(LastPart$)) / 2)
Rtrn$ = SPACE$(SideSpaces%) + LastPart$ + SPACE$(SideSpaces%) + Rtrn$
IF (ScreenWidth% - LEN(LastPart$)) / 2 <> INT((ScreenWidth% - LEN(LastPart$)) / 2) THEN Rtrn$ = " " + Rtrn$
Text$ = MID$(Text$, 1, CutLocation% - 1)
CatchInfiniteLoops% = CatchInfiniteLoops% + 1: IF CatchInfiniteLoops% < 0 THEN MaxCharactersPerLine% = MaxCharactersPerLine% + 1: GOTO TryAgain
LOOP UNTIL LEN(Text$) <= CurrentCharactersPerLine%
SideSpaces% = INT((ScreenWidth% - LEN(Text$)) / 2)
Rtrn$ = SPACE$(SideSpaces%) + Text$ + SPACE$(SideSpaces%) + Rtrn$
IF (ScreenWidth% - LEN(LastPart$)) / 2 <> INT((ScreenWidth% - LEN(LastPart$)) / 2) AND Left% = 1 THEN Rtrn$ = " " + Rtrn$
NumCharactersOnRemainingLine% = LEN(Text$)

EndOfLongCenterFUNCTION:
LongCenter$ = Rtrn$
END FUNCTION
I went looking for the second and found it in the Renaissance. The mechanical clocks were too new to tick at different moments. The rhythm became permanent. -- ASCIIhole 
Reply
#3
This IS NOT MY CODE.     This app actually was one of the example programs that came with QBasic in Dos 5.0

It compiles fine under QB64PE


Attached Files
.bas   MONEY.BAS (Size: 45.14 KB / Downloads: 14)
Reply
#4
(01-15-2026, 12:57 AM)ahenry3068 Wrote: This IS NOT MY CODE.     This app actually was one of the example programs that came with QBasic in Dos 5.0

It compiles fine under QB64PE

I like mine better
I went looking for the second and found it in the Renaissance. The mechanical clocks were too new to tick at different moments. The rhythm became permanent. -- ASCIIhole 
Reply
#5
(01-15-2026, 02:42 PM)ASCIIhole Wrote:
(01-15-2026, 12:57 AM)ahenry3068 Wrote: This IS NOT MY CODE.     This app actually was one of the example programs that came with QBasic in Dos 5.0

It compiles fine under QB64PE

I like mine better
   I wouldn't expect anything else.   I always like using tools I design myself as well.    I posted it merely in the hope that others might glean some information from the code and find it useful.     I think it's awesome that most of the old QBasic & QB45 example code build without changes in QB64PE !
Reply
#6
Well if we are comparing accounting methods here is my Accts Tracker in my GUIb package:
found at https://qb64phoenix.com/forum/showthread...689&page=8

One Picture should say it all:
   
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#7
(01-15-2026, 12:24 AM)ASCIIhole Wrote: Sleepy   Buggy. I posted this without realizing how buggy it was. Sorry.
(01-14-2026, 10:15 PM)ASCIIhole Wrote: It keeps track of balances and transactions for multiple accounts with an ability to search for transactions based on balance, transaction amount, transaction description or date. I find it quite useful Rolleyes

Posted this not 2 hours ago and I just found a bug I never noticed. The LongCenter$() FUNCTION doesn't work for short strings. This will fix that: [qb][FUNCTION LongCenter$ (Text$, MinCharactersPerLine%, MaxCharactersPerLine%, ScreenWidth%)
  IF LEN(Text$) <= MaxCharactersPerLine% THEN Rtrn$ = Text$: GOTO EndOfLongCenterFUNCTION
  TryAgain:
  OriginalString$ = Text$: NumCharactersOnRemainingLine% = 0: CatchInfiniteLoops% = 0
  DO
    BeforeCutLocation% = LEN(Text$) - MaxCharactersPerLine%
    CutLocation% = BeforeCutLocation%
    DO
      CutLocation% = CutLocation% + 1
    LOOP UNTIL MID$(Text$, CutLocation%, 1) = " "
    LastPart$ = MID$(Text$, CutLocation% + 1, LEN(Text$) - (CutLocation% + 1) + 1)
    Text$ = MID$(Text$, 1, CutLocation% - 1)
    CatchInfiniteLoops% = CatchInfiniteLoops% + 1: IF CatchInfiniteLoops% < 0 THEN MaxCharactersPerLine% = MaxCharactersPerLine% + 1: GOTO TryAgain
  LOOP UNTIL LEN(Text$) <= MaxCharactersPerLine%
  NumCharactersOnRemainingLine% = LEN(Text$)

  CurrentCharactersPerLine% = MaxCharactersPerLine% + 1
  DO WHILE NumCharactersOnRemainingLine% < MinCharactersPerLine%
    CurrentCharactersPerLine% = CurrentCharactersPerLine% - 1
    Text$ = OriginalString$
    DO
      BeforeCutLocation% = LEN(Text$) - CurrentCharactersPerLine%
      CutLocation% = BeforeCutLocation%
      DO
        CutLocation% = CutLocation% + 1
      LOOP UNTIL MID$(Text$, CutLocation%, 1) = " "
      LastPart$ = MID$(Text$, CutLocation% + 1, LEN(Text$) - (CutLocation% + 1) + 1)
      Text$ = MID$(Text$, 1, CutLocation% - 1)
    LOOP UNTIL LEN(Text$) <= CurrentCharactersPerLine%
    NumCharactersOnRemainingLine% = LEN(Text$)
    CatchInfiniteLoops% = CatchInfiniteLoops% + 1: IF CatchInfiniteLoops% < 0 THEN MaxCharactersPerLine% = MaxCharactersPerLine% + 1: GOTO TryAgain
  LOOP

  CurrentCharactersPerLine% = CurrentCharactersPerLine% - 1
  Text$ = OriginalString$
  Rtrn$ = ""
  DO
    BeforeCutLocation% = LEN(Text$) - CurrentCharactersPerLine%
    CutLocation% = BeforeCutLocation%
    DO
      CutLocation% = CutLocation% + 1
    LOOP UNTIL MID$(Text$, CutLocation%, 1) = " "
    LastPart$ = MID$(Text$, CutLocation% + 1, LEN(Text$) - (CutLocation% + 1) + 1)
    SideSpaces% = INT((ScreenWidth% - LEN(LastPart$)) / 2)
    Rtrn$ = SPACE$(SideSpaces%) + LastPart$ + SPACE$(SideSpaces%) + Rtrn$
    IF (ScreenWidth% - LEN(LastPart$)) / 2 <> INT((ScreenWidth% - LEN(LastPart$)) / 2) THEN Rtrn$ = " " + Rtrn$
    Text$ = MID$(Text$, 1, CutLocation% - 1)
    CatchInfiniteLoops% = CatchInfiniteLoops% + 1: IF CatchInfiniteLoops% < 0 THEN MaxCharactersPerLine% = MaxCharactersPerLine% + 1: GOTO TryAgain
  LOOP UNTIL LEN(Text$) <= CurrentCharactersPerLine%
  SideSpaces% = INT((ScreenWidth% - LEN(Text$)) / 2)
  Rtrn$ = SPACE$(SideSpaces%) + Text$ + SPACE$(SideSpaces%) + Rtrn$
  IF (ScreenWidth% - LEN(LastPart$)) / 2 <> INT((ScreenWidth% - LEN(LastPart$)) / 2) AND Left% = 1 THEN Rtrn$ = " " + Rtrn$
  NumCharactersOnRemainingLine% = LEN(Text$)

  EndOfLongCenterFUNCTION:
  LongCenter$ = Rtrn$
END FUNCTION/qb]
I went looking for the second and found it in the Renaissance. The mechanical clocks were too new to tick at different moments. The rhythm became permanent. -- ASCIIhole 
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Marquee Utility / Demo for Screen 0 Pete 3 599 09-18-2025, 12:42 AM
Last Post: Pete
  Keymapper Utility eoredson 0 506 05-31-2025, 01:38 AM
Last Post: eoredson
  Another Directory Tree Utility eoredson 0 484 04-18-2025, 02:52 AM
Last Post: eoredson
  The Copyit Utility eoredson 4 1,267 04-17-2025, 04:11 AM
Last Post: eoredson
  Off-topic utility krovit 0 439 04-09-2025, 02:28 PM
Last Post: krovit

Forum Jump:


Users browsing this thread: 1 Guest(s)