Guidance
指路人
g.yi.org
software / rapidq / examples / GUI / Grid / Address Book.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'by: "Jonathan Boles" Sat, 6 Jul 2002 16:10:25 +1000 [rapidq] Databases
'here's a simple address book app i whacked together quickly

     ? "Simple Database QStringGrid Demo (Address Book)"
     DEFSTR command, filename, name, address, phone
     DIM sg AS QSTRINGGRID
     sg.ColCount=3
     sg.RowCount=1
     sg.Separator=","
     DO
      ? "Enter Command:"
      INPUT command
      SELECT CASE LCASE$(command)
      CASE "quit": Application.Terminate
      CASE "load"
       ? "Enter filename: eg. demo.txt"
       INPUT filename
       sg.loadFromFile(filename,0,0,10000)
      CASE "save"
       ? "Enter filename:"
       INPUT filename
       sg.SaveTofile(filename,0,0,10000)
      CASE "add"
       ? "Enter Name:"
       INPUT name
       ? "Enter Address:"
       INPUT address
       ? "Enter Phone Number:"
       INPUT phone
       sg.RowCount=sg.RowCount+1
       sg.Cell(0,sg.RowCount-1)=name
       sg.Cell(1,sg.RowCount-1)=address
       sg.Cell(2,sg.RowCount-1)=phone
      CASE "show"
       FOR i=1 TO sg.rowCount-1
        ? "Name: "+sg.Cell(0,i)+"   Address: "+sg.Cell(1,i)+"Phone number: "+sg.Cell(2,i)
       NEXT
      CASE "find"
       ? "Enter name to retrieve data for:"
       INPUT name
       FOR i=1 TO sg.rowCount-1
        IF INSTR(LCASE$(sg.Cell(0,i)),LCASE$(name)) THEN PRINT "Name: "+sg.Cell(0,i)+"   Address: "+sg.Cell(1,i)+"   Phone number:"+sg.Cell(2,i)
       NEXT
      END SELECT
     LOOP
掌柜推荐
 
 
¥1,380.00 ·
 
 
¥888.00 ·
 
 
¥289.00 ·
 
 
¥289.00 ·
 
 
¥660.00 ·
 
 
¥1,800.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2009-07-25 17:30:04