Solved Check if config contains an index

Discussion in 'Plugin Development' started by Roborack17, Sep 12, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Roborack17

    Hello! Exactly what title says. I want to check if config contains an index because if I don't then it'll give me An internal error. Thanks in advance :D!
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    Roborack17

    It works with strings, int and booleans, but not with an index.
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    Roborack17

    @timtower
    Well, i'll explain some more. I want to remove a stringline from a config with an index, like remove first stringline by typing /remove 1. So, if the line 1 isn't existing, it gives me an internal error, so that's why i need to check if it exists. I'll be glad if you could help me
     
  6. Offline

    timtower Administrator Administrator Moderator

    @Roborack17 Load it to a value in the code, check if the value is below that length.
     
  7. Offline

    Roborack17

    How do i load it to a value? I know how to check if its below the length
     
  8. Offline

    timtower Administrator Administrator Moderator

  9. Offline

    Roborack17

    @timtower
    Is that like:

    if(!stringlist.size()<Index){
    code here?
    }
     
  10. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page