Allow different return types for 1 function
#1

Hello.

How can I allow a function to return two different types? IE if you specify returntype=1, it gives you a string return, if returntype=2 it will return a number instead. I'm trying to do multiple stuff in one function so I don't have to create two or three different ones.

Unfortunately, I currently get the error "error 079: inconsistent return types"
Reply
#2

Quote:
Originally Posted by Redirect Left
Посмотреть сообщение
Hello.

How can I allow a function to return two different types? IE if you specify returntype=1, it gives you a string return, if returntype=2 it will return a number instead. I'm trying to do multiple stuff in one function so I don't have to create two or three different ones.

Unfortunately, I currently get the error "error 079: inconsistent return types"
You could just return a string, but then use isnumeric to check if it's a numerical return.
Reply
#3

That isn't what I asked for. I see your ability to read is yet to improve.
Reply
#4

Quote:
Originally Posted by Redirect Left
Посмотреть сообщение
That isn't what I asked for. I see your ability to read is yet to improve.
If there is no fix then provide a workaround solution, just what I did. You obviously want everything in your hand for you as you cannot be bothered to do it.

Just because something doesn't work, doesn't mean you have to give up, you move on and work around it by creating and using a workaround.
Reply
#5

I did not ask for, nor desire a workaround. The question stated if it was possible. The reply was 'no'. The conversation would have ended there.

Instead it will end here, after you once again proved why you are an annoying user.
Reply
#6

Quote:
Originally Posted by Redirect Left
Посмотреть сообщение
I did not ask for, nor desire a workaround. The question stated if it was possible. The reply was 'no'. The conversation would have ended there.

Instead it will end here, after you once again proved why are you are an annoying user.
You didn't if it was possible, you said 'How can I allow a function to return two different types?'.

I told you a way you could do it as it was evidently that it wasn't possible.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)