The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1
Vijay_Gupta
Advanced Member


Reged: 09/10/11
Posts: 401
Can Win Setting affects Variable Conversion in VBS
      #712815 - 07/23/12 07:00 AM

In one of the thread started by me(http://www.sqaforums.com/showflat.php?Cat=0&Number=712813&page=0&vc=&PHPSESSID=#Post712813), belewada commented "VBScript converts variables using the windows settings on your machine. My guess is that you have some formatting specified for a Long value that causes it to be interpreted as a different value when compared. Maybe it's commas separating thousands digits or something like that. If so, you'll probably have to either change your windows settings to not format Long values or explicitly format the values before a comparison."

Can anyone or beleweda please let me know the windows setting that affects variable conversion in VBScript?

--------------------
Vijay
https://learn2automate.wordpress.com


Post Extras: Print Post   Remind Me!   Notify Moderator  
Rajkumar_RajangamModerator
Veteran


Reged: 10/22/10
Posts: 3136
Loc: Norway
Re: Can Win Setting affects Variable Conversion in VBS [Re: Vijay_Gupta]
      #712819 - 07/23/12 07:24 AM

Refer this article.

http://windows.microsoft.com/en-US/windo...nd-measurements

--------------------
Rajkumar


Post Extras: Print Post   Remind Me!   Notify Moderator  
Vijay_Gupta
Advanced Member


Reged: 09/10/11
Posts: 401
Re: Can Win Setting affects Variable Conversion in VBS [Re: Rajkumar_Rajangam]
      #712824 - 07/23/12 07:53 AM

Raj,

The above link lists the window setting. Can you please let me know, how it affects variable type conversion in VBScript?

--------------------
Vijay
https://learn2automate.wordpress.com


Post Extras: Print Post   Remind Me!   Notify Moderator  
AnemUday
Member


Reged: 01/18/08
Posts: 226
Re: Can Win Setting affects Variable Conversion in VBS [Re: Vijay_Gupta]
      #712853 - 07/23/12 07:22 PM

Because you are using VBScript, as many people mentioned "strings takes precedence over numeric" is correct.

So your code returns the right value.

I dont think you need to change any machine level settings.

--------------------
For more tips and resources visit my below blogs:
http://qtpftvideos.blogspot.in/
http://hpsqtp.blogspot.com/


Post Extras: Print Post   Remind Me!   Notify Moderator  
Vijay_Gupta
Advanced Member


Reged: 09/10/11
Posts: 401
Re: Can Win Setting affects Variable Conversion in VBS [Re: AnemUday]
      #712869 - 07/24/12 01:13 AM

Uday,

My query is: Is there any windows setting that can affect variable conversion in VBScript?

Need becomes secondary...I just want to know whether any window setting affect this or not?

--------------------
Vijay
https://learn2automate.wordpress.com


Post Extras: Print Post   Remind Me!   Notify Moderator  
my_name_is_rey
Member


Reged: 12/03/07
Posts: 73
Loc: Makati City, Manila
Re: Can Win Setting affects Variable Conversion in VBS [Re: Vijay_Gupta]
      #712881 - 07/24/12 03:49 AM

Vijay,


during runtime vbs is interpreted and binary sequence communicates the computer to perform operations and another sequence triggering the computer to save value in a particular memory address. in short the computer uses the lowest possible level and it doesn't care about the windows settings you mention.

windows settings standards and formats only allow you to change the numeric display format of a number not converting number to string or vise versa.

--------------------
.
.
.
Cheers,

Reynald S. Geonson


You can teach a student a lesson for a day; but if you can teach him to learn by creating curiosity, he will continue the learning process as long as he lives. - Clay P. Bedford
.
CLICK HERE... another set of skill i possessed

Edited by my_name_is_rey (07/24/12 03:49 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Vijay_Gupta
Advanced Member


Reged: 09/10/11
Posts: 401
Re: Can Win Setting affects Variable Conversion in VBS [Re: my_name_is_rey]
      #712882 - 07/24/12 04:32 AM

So, you mean to say that there is no windows setting that can affect "variable type conversion in VBScript"?

--------------------
Vijay
https://learn2automate.wordpress.com


Post Extras: Print Post   Remind Me!   Notify Moderator  
my_name_is_rey
Member


Reged: 12/03/07
Posts: 73
Loc: Makati City, Manila
Re: Can Win Setting affects Variable Conversion in VBS [Re: Vijay_Gupta]
      #712884 - 07/24/12 04:46 AM

precisely for windows settings standards and formats

Edited by my_name_is_rey (07/24/12 04:53 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Vijay_Gupta
Advanced Member


Reged: 09/10/11
Posts: 401
Re: Can Win Setting affects Variable Conversion in VBS [Re: my_name_is_rey]
      #712890 - 07/24/12 05:37 AM

Thanks Rey....I was confused by the statement made by belewada in my previous post and just want to clarify that.

--------------------
Vijay
https://learn2automate.wordpress.com


Post Extras: Print Post   Remind Me!   Notify Moderator  
my_name_is_rey
Member


Reged: 12/03/07
Posts: 73
Loc: Makati City, Manila
Re: Can Win Setting affects Variable Conversion in VBS [Re: Vijay_Gupta]
      #712891 - 07/24/12 05:39 AM

anytime vijay

--------------------
.
.
.
Cheers,

Reynald S. Geonson


You can teach a student a lesson for a day; but if you can teach him to learn by creating curiosity, he will continue the learning process as long as he lives. - Clay P. Bedford
.
CLICK HERE... another set of skill i possessed


Post Extras: Print Post   Remind Me!   Notify Moderator  
belewda
Member


Reged: 05/02/07
Posts: 267
Re: Can Win Setting affects Variable Conversion in VBS [Re: my_name_is_rey]
      #712905 - 07/24/12 07:13 AM

Rey is correct that the value isn't changed. However, the way that value is presented to you is changed at times. It isn't relevant in the situation you were talking about. I thought it might be. Sorry for the misleading information.

I was thinking, in particular, of the date display. Windows settings will affect how a date value is displayed. I was thinking it might be doing the same to your long numbers.

For an example of what I'm talking about, run this code
Code:

x = "10 jun 2012"

msgbox cdate(x)
msgbox x = "6/10/2012"



Now go to Control Panel | Region and Language. On the Formats tab, change the Short Date format to something other than the current value and run the code again. You'll see that the output from the cdate function is affected by the regional date setting in windows.

The value is still the same but if you're doing a string compare, it will fail.

--------------------
Dennis Belew


Post Extras: Print Post   Remind Me!   Notify Moderator  
Vijay_Gupta
Advanced Member


Reged: 09/10/11
Posts: 401
Re: Can Win Setting affects Variable Conversion in VBS [Re: belewda]
      #712908 - 07/24/12 07:49 AM

Yes. This will be affected but I was wondering how it can affect strings and integers. Anyways, thanks for clarification..

--------------------
Vijay
https://learn2automate.wordpress.com


Post Extras: Print Post   Remind Me!   Notify Moderator  
belewda
Member


Reged: 05/02/07
Posts: 267
Re: Can Win Setting affects Variable Conversion in VBS [Re: Vijay_Gupta]
      #712929 - 07/24/12 12:37 PM

I did some testing around it today and it doesn't seem to affect anything but times and dates. Even the currency types didn't change.

--------------------
Dennis Belew


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 58 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1061

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5