Jump to content

INI String Storage


erifash
 Share

Recommended Posts

Hello, I am new to these forums but have been programming in AutoIt for about four months now and just recently signed up. I figured out about the INIRead/Write functions and thought it would be cool to have a Post-It Note type program for storing strings. The INI.exe program is attached along with the source code. Any questions/comments will be very much appreciated. Thanks!

Link to comment
Share on other sites

  • Developers

Any questions/comments will be very much appreciated. Thanks!

<{POST_SNAPBACK}>

One thing I would recommend is to work with for..next loops and arrays when you do things like this just to keep you code shorter and flexible....

This should work in the same way:

dim $Storage[51]
Do
   $Loop = 1
   $Text = "INI.INI:" & @CRLF & @CRLF 
   For $x = 1 to 50
      $Storage[$x] = IniRead("INI.INI", "storage", StringFormat("%02d", $X), "blank")
      $Text = $text & StringFormat("%02d", $X) & " = " & $Storage[$x] & @CRLF
   Next
   $Text = $text & @CRLF & @CRLF & @CRLF & @CRLF & "Which value do you want to edit? Type in it's number."
   $key = InputBox("INI.EXE",$Text , "", "", 800, 900)
   If @error = 1 Then Exit
   If $key <= 0  or $key >= 51 Then
      MsgBox(16, "INI.EXE", "Invalid value!")
      Exit
   EndIf
   $value = InputBox("INI.EXE", "Type in variable " & $key & "'s new value." & @CRLF & "If you want to delete variable " & $key & ", type in ""code:delete"".")
   If @error = 1 Then Exit
   If $value = "code:delete" Then
      IniDelete("INI.INI", "storage", $key)
   Else
      IniWrite("INI.INI", "storage", $key, $value & "     (modified on " & @MON & "/" & @MDAY & "/" & @YEAR & " at " & @HOUR & ":" & @MIN & ":" & @SEC & ")")
   EndIf
Until $loop = 0

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...