Results 1 to 7 of 7

Thread: writeing iun a ini without trunecing it

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default writeing iun a ini without trunecing it

    is there any way to make scar write a ini file or text w/e on and not delete everything in the file

    i currently have

    SCAR Code:
    procedure SaveusernameToFile;
    var
      i : Integer;
    begin
       inc(i);
       WriteINI('username', inttostr(i), 'uername', AppPath + 'Username.INI');
    end;

  2. #2
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I'm not following what you want.

    WriteINI just overwrites the current key. You could Read that same key and add it on if thats what you mean...

    SCAR Code:
    procedure AppendINI(Section, KeyName, App, Path: String);
    var
      s: String;
    begin
      s := ReadINI(Section, Keyname, Path);
      WriteINI(Section, KeyName, s + App, Path);
    end;

    Slow but stops the truncation, kinda..
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  3. #3
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    well will a text file work better cause a text file would be fine to but i only know how to do ini

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    When using INI's, it will only overwrite, never truncate.
    It's normal file writing that just writes over everything already in there.

    The only reason why your example at the top fails is that i is a local variable rather than global - if it were global, then it would be fine and the first time it would do section "username" and key "1", though you probably want to alter the value it writes as it currently would just put "username" again and again. Second time it would have "1" as key though, so it would leave "2" alone.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    well username will be replaced with the geneated username in the script

  6. #6
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    What do you need it for? Maybe we can suggest something.
    Interested in C# and Electrical Engineering? This might interest you.

  7. #7
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    well im working on a account creater and tut runner and it will save the user names the pasword is preset for every charecter but i got it now

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •