Declare variables of input box

Gavx

Registered User.
Local time
Today, 15:54
Joined
Mar 8, 2014
Messages
155
Code of the MSDN site gives this sample code for an input box.

Code:
Dim Message, Title, Default, MyValue
Message = "Enter a value between 1 and 3"    ' Set prompt.
Title = "InputBox Demo"    ' Set title.
Default = "1"    ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)

Why hasn't the data type for the variables been declared? Is it because Input Box can only accept strings in these fields...and so it is implicit? But then Default is an integer?
 
i think your correct, it string.
 
What has me wondering was that they were defined as Variant type? The fields only accept string fields, and variant type take up more space.

I just thought there might have been a specific reason for this style of definition.
 
It looks like VBScript. In VBScript there is no compiler and no datatypes, so its perfect. But we can't say without seeing the site.
 

Users who are viewing this thread

Back
Top Bottom