RosettaCodeData/Task/Use-another-language-to-call-a-function/Wren/use-another-language-to-call-a-function-1.wren
2024-03-06 22:25:12 -08:00

13 lines
375 B
Text

/* Use_another_language_to_call_a_function.wren */
class RCQuery {
// Both arguments are lists as we need pass by reference here
static query(Data, Length) {
var s = "Here am I"
var sc = s.count
if (sc > Length[0]) return 0 // buffer too small
for (i in 0...sc) Data[i] = s[i].bytes[0]
Length[0] = sc
return 1
}
}