Declare variables of input box (1 Viewer)

Gavx

Registered User.
Local time
Today, 16:32
Joined
Mar 8, 2014
Messages
151
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?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:32
Joined
May 7, 2009
Messages
19,247
i think your correct, it string.
 

Gavx

Registered User.
Local time
Today, 16:32
Joined
Mar 8, 2014
Messages
151
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.
 

MarkK

bit cruncher
Local time
Yesterday, 23:32
Joined
Mar 17, 2004
Messages
8,183
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

Top Bottom