Computer Science Canada

"Do you want to leave a message?"

Author:  templest [ Thu Jul 29, 2004 5:18 pm ]
Post subject:  "Do you want to leave a message?"

I hate looking for pens/paper when someone calls and they wnat to leave a message to a sibling that isn't home. So I wrote this quick mofo' to jot down quick notes when someone calls, stores the name / message and the number in which to contact them.

I know I don't need the arrays, and I could probably store the numbers and names on the same string, but I did it seperatly and in arrays because I want to give people a small challenge.

This is the basic code for processing the info', I want someone to write the esthetics, ie: GUI. Wink

Whoever write's the most badass interface get's 25 bits.

code:
proc add (name, number : string)
    var dummy_buffer : string
    var file : int
    open : file, "book.ini", get, put, mod
    loop
        exit when eof (file)
        get : file, dummy_buffer : *
    end loop
    put : file, name
    put : file, number
    close (file)
end add

proc gets
    var file : int
    var numb : int := 0
    var count_buffer : string
    open : file, "book.ini", get
    loop
        exit when eof (file)
        get : file, count_buffer : *
        get : file, count_buffer : *
        numb := numb + 1
    end loop
    close (file)
    var users : array 1 .. numb of string
    var numbr : array 1 .. numb of string
    open : file, "book.ini", get
    for i : 1 .. numb
        get : file, users (i) : *
        get : file, numbr (i) : *
        put users (i) /* comment out this line if you're making a GUI */
        put "" : 10, numbr (i) : 6 /* as well as this one*/
    end for
    close (file)
end gets

var input, name, number : string
loop
    put ">> " ..
    get input : *
    if length (input) = 4 and input = ".add" then
        put "name: " ..
        get name : *
        put "number: " ..
        get number : *
        add (name, number)
    elsif length (input) = 5 and input = ".dump" then
        gets
    elsif input = "quit" then
        quit
    end if
end loop

Author:  templest [ Thu Jul 29, 2004 6:53 pm ]
Post subject: 

someone move this thread to the "contests" section. Wink

Author:  Kingnoz [ Fri Jul 30, 2004 2:52 pm ]
Post subject: 

Here you go templest. This is the cheap message program for you...can only hold 40 messages...if anyone wants to extend on it go ahead.

Author:  templest [ Thu Aug 05, 2004 7:25 pm ]
Post subject: 

I don't get it... all it does it display what's inside the text file? What happened to adding to the text file from within the program? Razz

Author:  Kingnoz [ Thu Aug 05, 2004 11:20 pm ]
Post subject: 

You really didn't try it fully did u...

If you would click file, new message then there would be a popup window.
Inside this magical window you can put a name/message/whatever and number then click add message and POOF it is added to the text file.
Now click cancel and it closes the popup. Then go to file and click open message and then it has a listing of the all the messages. Click a message button and u can see ur message.


You really need to try the program before posting a stupid comment...

Quote:
I don't get it... all it does it display what's inside the text file? What happened to adding to the text file from within the program?

Author:  rizzix [ Fri Aug 06, 2004 11:03 pm ]
Post subject: 

Kingnoz wrote:

You really need to try the program before posting a stupid comment...
Quote:
I don't get it... all it does it display what's inside the text file? What happened to adding to the text file from within the program?


dont need to be rude Smile

Author:  this_guy [ Sun Aug 08, 2004 9:57 am ]
Post subject: 

stupid *$*@# crashed my comp...

really wished some1 wud tell me where 4.05 is

Author:  DanShadow [ Sun Aug 08, 2004 9:41 pm ]
Post subject: 

Well....you could always try http://holtsoft.com Thats where I found it awile ago.

Author:  Kingnoz [ Mon Aug 09, 2004 11:21 pm ]
Post subject: 

this_guy wrote:
stupid *$*@# crashed my comp...

really wished some1 wud tell me where 4.05 is



I didn't do this in 4.05, so that shouldn't be an issue for you.

Author:  beard0 [ Tue Aug 10, 2004 10:24 am ]
Post subject: 

Here's my nice little Phone Messager interface, using templest's storing system.

Author:  beard0 [ Fri Aug 20, 2004 12:42 pm ]
Post subject: 

Hey templest!
When's the deadline for your contest? Are we allowed to add features? (i.e. delete an old message)

Author:  templest [ Sun Aug 22, 2004 10:06 pm ]
Post subject: 

Go right ahead... since yours seems to be the only submission thus far, I'm trying to give people a chance. Smile

Tell you what, the winning submission gets bonus bits for every aded feature. Basically, write a kick-ass "Message Taker" branching off from the code that I provided. (10 bits for every feature, significant features ie: deleting messages Wink )

EDIT: Very nice by the way. Very Happy

Author:  zomg [ Thu Oct 14, 2004 10:50 am ]
Post subject: 

lol i love it... ive used it like 3 times lol keep up the good work

Author:  timmytheturtle [ Fri Oct 15, 2004 3:19 pm ]
Post subject: 

seems like a good idea for a program, but I find it easier to use notepad

Author:  Hikaru79 [ Sun Oct 17, 2004 12:19 am ]
Post subject: 

this_guy wrote:
stupid *$*@# crashed my comp...

really wished some1 wud tell me where 4.05 is


Check the thread in "Programming News" called "Turing 4.0.5." On page 6 there's a link where someone posted it. Enjoy Smile

Author:  templest [ Sun Oct 17, 2004 9:46 am ]
Post subject: 

The advantage of this app is that it's more organized than notepad. I would know, after a while I had a 600+ line notepad page all with numbers and messages. I just found it easier to write an app to organize/display the data. Anyways, yeah.. this is an ooooooooold as thread. I guess we know who our winner is.


: