Derek Parnell EDB Windows
- Posted by sixs at ida.net Mar 16, 2002
- 356 views
This is a multi-part message in MIME format. ------=_NextPart_000_001E_01C1CD13.E32351E0 charset="iso-8859-1" Hello I am using EditText, I am wanting to display a record I find back into the input fields These are the windows fields: I am adding records with and automatic numer as key llastname = create(EditText,"llname",lv,325,2,130,20,0), tkey = create(LText,"Key",BigWin,25,352,35,20,0), ekey = create(EditText,"",BigWin,115,352,33,25,0), tPnone = create(LText,"Phone NO",BigWin,25,2,150,20,0), phonenumber = create(EditText,"",BigWin,115,2,130,20,0), tLname = create(LText,"Last Name",BigWin,25,25,130,20,0), lastname = create(EditText,"lname",BigWin,115,25,130,20,0), tFname = create(LText,"First name",BigWin,25,52,130,20,0), firstname = create(EditText,"fname",BigWin,115,52,130,20,0), tMid = create(LText,"Mid Initial",BigWin,25,82,130,20,0), middleinitial = create(EditText,"midinit",BigWin,115,82,130,20,0), tstreet = create(LText,"Street No",BigWin,25,112,130,20,0), sequence key, data, ms integer f, key_num wcphonenumber = {} wclastname = {} wcfirstname = {} wcmiddleinitial = {} wcphonenumber = getText(phonenumber) wclastname = getText(lastname) wcfirstname = getText(firstname) key_num = (db_table_size())+1 f = db_find_key(key_num) if f >= 1 then rtn_code = message_box("duplicate record", "remind for Win98", MB_ICONWARNING+MB_OK) -- show(SCREEN, db_record_key(f), db_record_data(f)) -- puts(SCREEN, "Do you want to update this record? (y/n) ") else data = {} data = {wcphonenumber, lastname,firstname} if db_insert(key_num,data) != DB_OK then rtn_code = message_box("error adding record", "remind for Win98", MB_ICONWARNING+MB_OK) else rtn_code = message_box("added record", "remind for Win98", MB_ICONWARNING+MB_OK) end if end if end procedure -- find a record to the database integer tlastname, a, cur_key sequence line1, rec, ms line = {} a = (db_table_size()) ms =( sprintf("Num of records #%d\n",{a})) rtn_code = message_box(ms, "remind for Win98", MB_ICONWARNING+MB_OK) for rtn_code = 1 to db_table_size() do -- rec = db_record_key(rtn_code) cur_key = db_record_key(rtn_code) line = db_record_data(rtn_code) if length(line) <= 0 then myfatal(ms) end if setText(phonenumber,upper(line1[3])) setText(lastname,line[3]) setText(firstname,(upper(line))) setText(middleinitial,(upper(line))) -- setText(street,upper(line[6])) -- setText(city,upper(line[7])) -- setText(state,upper(line[8])) -- setText(zip,upper(line[9])) -- setText(afil,upper(line[10])) -- setText(wealth,upper(line[11])) -- setText(source,upper(line[12])) -- setText(prof,upper(line[13])) setText(ekey,(upper(line))) setVisible(lastname, True) setVisible(firstname, True) setVisible(middleinitial, True) -- setVisible(street, True) -- setVisible(city, True) -- setVisible(state, True) -- setVisible(zip, True) -- setVisible(afil, True) -- setVisible(wealth, True) -- setVisible(source, True) -- setVisible(prof, True) -- setText(ERROR,f) setText(llastname,line) setVisible(llastname, True) end for end procedure ------=_NextPart_000_001E_01C1CD13.E32351E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 8bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type> <META content="MSHTML 5.00.2722.2800" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2>Hello</FONT></DIV> <DIV><FONT face=Arial size=2>I am using EditText, </FONT></DIV> <DIV><FONT face=Arial size=2>I am wanting to display a record I find back into the input fields</FONT></DIV> <DIV><FONT face=Arial size=2>These are the windows fields:</FONT></DIV> <DIV><FONT face=Arial size=2>I am adding records with and automatic numer as key</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>llastname = create(EditText,"llname",lv,325,2,130,20,0),<BR>tkey = create(LText,"Key",BigWin,25,352,35,20,0),<BR>ekey = create(EditText,"",BigWin,115,352,33,25,0),<BR>tPnone = create(LText,"Phone NO",BigWin,25,2,150,20,0),<BR>phonenumber = create(EditText,"",BigWin,115,2,130,20,0),<BR>tLname = create(LText,"Last Name",BigWin,25,25,130,20,0),<BR>lastname = create(EditText,"lname",BigWin,115,25,130,20,0),<BR>tFname = create(LText,"First name",BigWin,25,52,130,20,0),<BR>firstname = create(EditText,"fname",BigWin,115,52,130,20,0),<BR>tMid = create(LText,"Mid Initial",BigWin,25,82,130,20,0),<BR>middleinitial = create(EditText,"midinit",BigWin,115,82,130,20,0),<BR>tstreet = create(LText,"Street No",BigWin,25,112,130,20,0),</FONT></DIV> <DIV><FONT face=Arial size=2>-----------------------------------------------------<BR>procedure onClick_btnAdd()<BR> ------------------------------------------------</FONT></DIV> <DIV><FONT face=Arial size=2> sequence key, data, ms<BR> integer f, key_num<BR> wcphonenumber = {}<BR> wclastname = {} <BR> wcfirstname = {}<BR> wcmiddleinitial = {}<BR> wcphonenumber = getText(phonenumber)<BR> wclastname = getText(lastname) <BR> wcfirstname = getText(firstname)<BR> key_num = (db_table_size())+1<BR> f = db_find_key(key_num)<BR> if f >= 1 then<BR> rtn_code = message_box("duplicate record",<BR> "remind for Win98", MB_ICONWARNING+MB_OK)<BR>-- show(SCREEN, db_record_key(f), db_record_data(f))<BR>-- puts(SCREEN, "Do you want to update this record? (y/n) ")<BR>else<BR> <BR> data = {}<BR> data = {wcphonenumber, lastname,firstname}<BR> <BR> <BR> if db_insert(key_num,data) != DB_OK then<BR> rtn_code = message_box("error adding record",<BR> "remind for Win98", MB_ICONWARNING+MB_OK)<BR> else<BR> rtn_code = message_box("added record",<BR> "remind for Win98", MB_ICONWARNING+MB_OK)<BR> end if<BR>end if</FONT></DIV> <DIV><FONT face=Arial size=2>end procedure</FONT></DIV> <DIV><FONT face=Arial size=2>--------------------------------------------------------------</DIV></FONT> <DIV><FONT face=Arial size=2>global procedure onClick_btnFind()</FONT></DIV> <DIV><FONT face=Arial size=2>--------------------------------------------------------------<BR> -- find a record to the database<BR>integer tlastname, a, cur_key<BR>sequence line1, rec, ms<BR>line = {}<BR>a = (db_table_size())<BR>ms =( sprintf("Num of records #%d\n",{a}))<BR> rtn_code = message_box(ms,<BR> "remind for Win98", MB_ICONWARNING+MB_OK)<BR> for rtn_code = 1 to db_table_size() do<BR>-- rec = db_record_key(rtn_code)<BR> cur_key = db_record_key(rtn_code)<BR> line = db_record_data(rtn_code) <BR> if length(line) <= 0 then<BR> myfatal(ms)<BR> end if<BR>setText(phonenumber,upper(line1[3]))<BR>setText(lastname,line[3])<BR> setText(firstname,(upper(line)))<BR> setText(middleinitial,(upper(line)))<BR> -- setText(street,upper(line[6]))<BR> -- setText(city,upper(line[7]))<BR> -- setText(state,upper(line[8]))<BR> -- setText(zip,upper(line[9]))<BR>-- setText(afil,upper(line[10]))<BR>-- setText(wealth,upper(line[11]))<BR>-- setText(source,upper(line[12]))<BR>-- setText(prof,upper(line[13]))<BR> setText(ekey,(upper(line)))<BR> setVisible(lastname, True) <BR> setVisible(firstname, True) <BR> setVisible(middleinitial, True) -- setVisible(street, True) <BR>-- setVisible(city, True) <BR>-- setVisible(state, True) <BR>-- setVisible(zip, True)<BR>-- setVisible(afil, True) <BR>-- setVisible(wealth, True) <BR>-- setVisible(source, True) <BR>-- setVisible(prof, True) <BR> -- setText(ERROR,f)<BR>setText(llastname,line) <BR>setVisible(llastname, ------=_NextPart_000_001E_01C1CD13.E32351E0--