Killzone kid – User talk

From Bohemia Interactive Community
Jump to navigation Jump to search
 
Line 5: Line 5:
{{Important | This command cannot force return type, it will return the value of the type given in config. Use isEqualType to additionally reaffirm the correct type if necessary to account for human error.}}
{{Important | This command cannot force return type, it will return the value of the type given in config. Use isEqualType to additionally reaffirm the correct type if necessary to account for human error.}}
I think it is confusing as no command can "force" any type, why this specific note on this specific command? - [[User:Lou Montana|Lou Montana]] ([[User talk:Lou Montana|talk]]) 13:55, 10 September 2019 (CEST)
I think it is confusing as no command can "force" any type, why this specific note on this specific command? - [[User:Lou Montana|Lou Montana]] ([[User talk:Lou Montana|talk]]) 13:55, 10 September 2019 (CEST)
:Say you want an array: myArray[] = {1,2,3}; You write  getMissionConfigValue [myArray, []], right? So no param, you guaranteed to get empty array. But user can write myArray = 123; and you will get 123 instead of array and script error. This is what I mean by you cannot enforce type so that it will return array no matter what. [[User:killzone_kid|killzone_kid]] ([[User talk:killzone_kid|talk]]) 14:13, 10 September 2019 (CEST)

Revision as of 13:13, 10 September 2019

getMissionConfigValue note

Hello, I admit I didn't understand your note there:

This command cannot force return type, it will return the value of the type given in config. Use isEqualType to additionally reaffirm the correct type if necessary to account for human error.

I think it is confusing as no command can "force" any type, why this specific note on this specific command? - Lou Montana (talk) 13:55, 10 September 2019 (CEST)

Say you want an array: myArray[] = {1,2,3}; You write getMissionConfigValue [myArray, []], right? So no param, you guaranteed to get empty array. But user can write myArray = 123; and you will get 123 instead of array and script error. This is what I mean by you cannot enforce type so that it will return array no matter what. killzone_kid (talk) 14:13, 10 September 2019 (CEST)