Sign in to follow this  
Followers 0
erifash

INI String Storage

3 posts in this topic

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!

Share this post


Link to post
Share on other sites



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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0