Skrip Posted July 12, 2006 Share Posted July 12, 2006 Run it, read the instructions in the input box. You can store phone numbers on it. It will help me out alot, hope it helps you. Will add the function so you can see all the numbers stored next version. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
RazerM Posted July 12, 2006 Share Posted July 12, 2006 (edited) I like the idea of this. I changed it to use arrays, it saves all records to file when it closes and opens them when it starts. expandcollapse popup#include <array.au3> Global $name, $number, $names[1], $numbers[1] $initest = IniReadSectionNames(@ScriptDir & "\Numbers.ini") If _ArraySearch($initest, "Names", 1) <> -1 Then $num = IniReadSection(@ScriptDir & "\Numbers.ini", "Names") For $i = 1 To $num[0][0] _ArrayAdd($names, IniRead(@ScriptDir & "\Numbers.ini", "Names", $i, "empty")) _ArrayAdd($numbers, IniRead(@ScriptDir & "\Numbers.ini", "Numbers", $i, "empty")) Next EndIf main() Func main() While 1 $name = InputBox("Phone Number Finder", "Please enter the name of the person..." & @LF & "Type /add to enter a number" & @LF & "Type /remove to remove an entered number") If @error = 1 Then Exit Else If $name = "/add" Then _add() ElseIf $name = "/remove" Then _remove() ElseIf $name <> "/add" or "/remove" Then _read() EndIf EndIf WEnd EndFunc ;==>main Func _add() Local $add_p = InputBox("Add A Phone Number", "Please enter the phone number you want to add.") If @error Then Return Local $add_n = InputBox("Add A Name", "Please enter the name of the person whose number you just entered.") If @error Then Return ;~ IniWrite(@ScriptDir & "\Numbers.ini", $add_n, $add_n, $add_p) _ArrayAdd($numbers, $add_p) _ArrayAdd($names, $add_n) MsgBox(0, "Number Added", "Name and number added to database.") EndFunc ;==>_add Func _read() ;~ Local $number_m = IniRead(@ScriptDir & "\Numbers.ini", $name, $name, $name & " not found.") $pos = _ArraySearch($names, $name) If Not @error Then MsgBox(0, "Number", $numbers[$pos]) Else MsgBox(0, "Number", "Name not found") EndIf EndFunc ;==>_read Func _remove() Local $remove_n = InputBox("Remove A Phone Number", "Please enter the name you want to remove.") If @error Then Return $pos = _ArraySearch($names, $remove_n) If Not @error Then _ArrayDelete($names, $pos) _ArrayDelete($numbers, $pos) EndIf ;~ IniDelete(@ScriptDir & "\Numbers.ini", $remove_n) MsgBox(0, "Removed", "The phone number of " & $remove_n & " has been removed.") EndFunc Func OnAutoItExit() For $i = 1 To UBound($names) - 1 IniWrite(@ScriptDir & "\Numbers.ini", "Names", $i, $names[$i]) IniWrite(@ScriptDir & "\Numbers.ini", "Numbers", $i, $numbers[$i]) Next EndFunc Edited July 12, 2006 by RazerM My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Paulie Posted July 12, 2006 Share Posted July 12, 2006 (edited) Not bad, I might find this usefull, butI have a few sugestions for inprovementInstead of using .ini files, try doing something with normal .txt files.To view all the phone numbers, make a "listview" GUImake a GUI that allows you to do everything in 1 or 2 windowsWhy?1- Ini files have a size limit, and are therefore not useful for storing large amounts of data, this couldn't hold 50 numbers and names.2- I made a previous program that list statments from a text file, then puts it in a listview, it would suit you PERFECT. and it will also be able to show names numbers and any other useful info you might be so inclined as to store3- It'll clean up your program, i don't like having to type and click over and over just to enter a name, make the input controls in the gui so there aren't so many windowsEDIT:Aww razer you beat me Edited July 12, 2006 by Paulie Link to comment Share on other sites More sharing options...
RazerM Posted July 12, 2006 Share Posted July 12, 2006 @Paulie I have an ini file created with AutoIt that contains 224908 keys, which is far enough for phone number entries My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Skrip Posted July 12, 2006 Author Share Posted July 12, 2006 GJ RazerM I'll work off of that. I've never really worked with arrays before. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now