1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Save array

Discussion in 'Scripting Workshop' started by Aderre, May 28, 2014.

  1. Aderre

    Aderre Member

    Messages:
    33
    Hi, I'm trying to modify the code that comes in the ksp reference to save two parameters at once, the default table's one, and plus a knob's one. The code looks like this, but it won't let me apply, because there's some "newline expected".

    It writes the new line expected at this line

     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Why are you using a new array for just the knob parameter? Put it all in one array, it makes more sense.


    Also, when pasting code, please make sure that indents are preserved. The way the code is presented in your post is hard to follow because there are no indents.


    As for your problem - $knob is not an array. So what's that [$count] doing next to it? Basics of programming...
     
  3. Aderre

    Aderre Member

    Messages:
    33
    Thank you, now the code looks better with your method, it saves the table parameter, but it do freak things with the knob parameters, like i save it on 33 and when i load it loads it on 100. I copied it here with the indents, in edit mode they are there, but in the post somehow not?

    and sorry for that count thing, I'm just learning this, and couldn't find this kind of information, that which parameter doesn't work with another one.
     
    Last edited: May 28, 2014