forum-msg-id-135097-edit
Original date:2020-10-05 10:33:21 Edited by: Senator Subject: Re: Budget Builder
----------------------- beginning of register.ex part 3 ------------------------------------------------------------- constant MENU = sprintf("%s", { """ 1 add record 8 edit record data 2 delete record 9 DbDump 3 list all 10 list tables 4 display fullnote 11 rename table 5 toggle tables 12 select table 6 select cash table 13 backup 7 autolog budget 14 search all 17 list all 15 select search month 18 select list month 16 search current month 19 list current month 0 quit 20 list prior month 21 compress database #: """ }) constant PRIOR=1, CURRENT=0 procedure main() sequence text integer s datetime dt = now() init_text_formatter() set_background_color(BGC) set_foreground_color(MC) init_db() -- check_free_list() --list() -- list all -- list(dt[YEAR], dt[MONTH]) -- current year/month while 1 do if equal(current_table, REGISTER) then check_autolog_flag() end if set_foreground_color(MC) -- MC = Menu Color text = text:format("[]",{db_current_table()}) puts(1,"\n\n\t\t\t\tBudget Buddy: ") hilite(text,YELLOW,1) puts(1,"\n\t\t\t\t") dt = now() -- display current date text = datetime:format(dt, "%A, %B %d '%y %l:%M%P") set_foreground_color(BLUE) display(text,0) hilite("*",YELLOW,0) puts(1,"\n\n") set_foreground_color(MC) s = prompt_number(MENU,{0,21}) -- display menu switch s do case 0 then quit() case 1 then add_record() case 2 then delete_record() case 3 then list() -- list all case 4 then display_full_note() any_key("\n") case 5 then toggle_tables() case 6 then select_cash_table() list() case 7 then autolog_budget() case 8 then list() edit_record_data() case 9 then DbDump() case 10 then list_tables() case 11 then rename_table() case 12 then select_table() case 13 then backup_prj_files() -- 13 = select switch case 14 then search() -- search all case 15 then search(13,13) -- select search YEAR/MONTH case 16 then dt=now() -- search current search(dt[YEAR],dt[MONTH]) -- YEAR/MONTH case 17 then list() case 18 then list(13,13) -- select YEAR/MONTH to list case 19 then list_month(CURRENT) -- list current YEAR/MONTH case 20 then list_month(PRIOR) -- list current year/PRIOR MONTH case 21 then db_compress() case else any_key("\n\tThat key does nothing - Press Any Key to continue...") end switch end while end procedure main() ----------------------- end of register.ex part 3 ----------------------- end of register.ex -------------------------------------------------------------
Not Categorized, Please Help
|