Thread: VAL keyword
View Single Post
  #14 (permalink)  
Old 09-10-2010, 01:48 PM
beacon beacon is offline
Newbie
 
Join Date: Sep 2010
Posts: 2
Smile

I agree that it would be very useful.

Here is a typical use for Val():

A User types a time into a textbox, say "18:36".

I extract the hours portion using stringsex.mid to give a string called (say) MyHours holding "18".

Now I can code

if val(MyHours)<12 then
.......
end if

See how the computation is treating the string "18" as the value 18.

Voila!

I use this Val() function in VB6 a lot.

Is this helpful?
Reply With Quote