Ah okay. Anyway you probably use/used a wait() somewhere in your original 'sec_func' before returning the value. Otherwise is should work.
Yes i tried that but the manual says:
A function that contains a wait loop can not return a parameter, because wait() already returns to the calling function before the final return statement is excecuted.
And thats my problem. Thats why i think about a workaround.