A89: A Address book With Some Real Problems


[Prev][Next][Index][Thread]

A89: A Address book With Some Real Problems




The source is on the bottom of the message:
ok, i am trying to get a address book written in c for the calc, but my 
main problem right now is that i can not get the request dialogs working 
right, what am i doing wrong?
Also, how can i disable the help messages when i call a dialog, ie i want 
to disp my own instead of the use the arrow keys and enter or esc stuff.
Any help would be welcomed.
Thanks
----
// Address book 2K PLUS
// Created 8/22/00; 2:56:11 PM

#define SAVE_SCREEN

#include <nostub.h>
#include <all.h>

int _ti89;
int _ti92plus;

char 	static FName	[100]	[15]={{0}};
char 	static LName	[100]	[15]={{0}};
char 	static Phone	[100]	[10]={{0}};
char 	static Fax	[100]	[10]={{0}};
char 	static Email	[100]	[30]={{0}};
char 	static Address	[100]	[30]={{0}};
char 	static 	CSZ	[100]	[30]={{0}};
int 	result=0;
int 	handle=0;
char*	b1 = 0;
char*	b2 = 0;
char* 	b3 = 0;
char* 	b4 = 0;
char*	b5 = 0;
char*	b6 = 0;
char* 	b7 = 0;
char 	*buffer="\0";
int	dummy=0;

int editen(int en)
{
	en--;
	b1=FName[en];
	b2=LName[en];
	b3=Phone[en];
	b4=Fax[en];
	b5=Email[en];
	b6=Address[en];
	b7=CSZ[en];
	  strncat (buffer, b1, 15);
	  strncat (buffer, b2, 15);
	  strncat (buffer, b3, 10);
	  strncat (buffer, b4, 10);
	  strncat (buffer, b5, 30);
	  strncat (buffer, b6, 30);
	  strncat (buffer, b7, 30);
	handle = DialogNewSimple (140, 93);
	DialogAddTitle (handle, "Add/Edit Entry", BT_OK, BT_CANCEL);
	DialogAddRequest (handle, 3, 13, "First Name:",   6, 15, 10);
	DialogAddRequest (handle, 3, 23, "Last Name:",    6, 30, 10);
	DialogAddRequest (handle, 3, 33, "Phone Number:", 6, 40, 10);
	DialogAddRequest (handle, 3, 43, "Fax Number:",   6, 50, 10);
	DialogAddRequest (handle, 3, 53, "Email Address:",6, 80, 10);
	DialogAddRequest (handle, 3, 63, "Address:",      6, 110, 10);
	DialogAddRequest (handle, 3, 73, "City State Zip:", 6, 140, 10);
	dummy=DialogDo (handle, CENTER, CENTER, buffer, NULL);
	if(dummy==1)
	{
		ST_helpMsg("Changes Saved");
		

		//Split *buffer into strings and save them
	}
	else
	{
		ST_helpMsg("Changes Not Saved");
	}
	return 0;
}	

int ab()
{
	editen(1);
	return 0;
}

int cal()
{
	return 0;
}

int _main()
{
	ST_helpMsg("Welcome to Address book 2K Plus");
	result=1;
	while(result!=0&&result!=9)
	{
		handle = PopupNew ("Address book 2K PLUS", 0);
		PopupAddText (handle, -1, "Calender", 1);
		PopupAddText (handle, -1, "Address Book", 2);
		PopupAddText (handle, -1, "Quit", 9);
		result = PopupDo (handle, CENTER, CENTER, 0);
		if(result == 2)
			ab();
		if(result == 1)
			cal();
	}
	return 0;
}
Rob Smith
----
Stupidity got us into this mess - why can't it get us out?
Proud member of:
    * <http://pa.ticalc.org>Programmers Anonymous
    * <http://www.tigalaxy.com>TIGALAXY
    * <http://c489.tigalaxy.com>C489
    * <aim:addbuddy?screenname=Billvortex>Add Me To Your AIM Buddy List