Jump to content

HomeWork Question - VAL()

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
I can't find the answer to this:

What is the value returned by the following Val function call?
Val("-3 4 5 six 7")

Answers:

-34567
34567
345
-345
0


Anyone know? I think -345

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Why don't you try the function?

I looked up the function at MSDN, and from what I read there, I would say the result should be -3457, but that's not an option. On the other side, if Visual Basic have something built-in, that f.ex. converts "six" to "6", then I would say -34567. But as I said, try using the function.

The VAL-function at MSDN.

#3
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
That is what I ended up doing. The function returned "Cannot covert to a number" but then placed -345 in my label as the result.