Brilliant! Thanks yet again. How did you get from the dictionary entry to your script. I looked and could not see a way of getting a return value back into LCB.
Here is my version of your script that returns a "Number" to the calling handler. ( I tied my self in knots with extracting and changing the variable type from string to number)
Code: Select all
private handler GetSystemVersion() returns Number
variable tSystemversion as String
variable tListOfString as List
variable tListOfNum as List
variable tOsVerNo as Number
log "GetSystemVersion was called"
execute script "return the systemVersion"
put the result into tSystemversion
log "tSystemversion is a string : " & tSystemversion
split tSystemversion by "." into tListOfString
log "tSystemversion is a list of strings : "
log tListOfString
--execute script "answer the systemversion"
put tListOfString parsed as list of number into tListOfNum
log "tListOfNum is a list of numbers : "
log tListOfNum
put element 1 of tListOfNum into tOsVerNo
log "Variable tOsVerNo is now set to number : " & tOsVerNo formatted as string
return tOsVerNo
end handler
Simon