?
Solved

Windows 7 variable undefined error

Posted on 2009-05-13
5
Medium Priority
?
387 Views
Last Modified: 2013-11-25
I have a windows application that is calling some specific variables, I don't know if they are environment variables, or what exactly they are.  examples are clWhite, clRed (obviously colors), clWindow, etc.  They all appear to begin with cl.  

The application runs just fine in XP, Vista.  In Windows 7, when these variables are referenced the application returns a variable undefined error.

Are these variables somehow a part of the XP, VIsta, but not included in Windows 7?
0
Comment
Question by:misgroupee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 24380375
Hi, perhaps in Windows 7 (whichever version of the Windows Scripting Host they may have), forces explicit declaration of your variables.  All you should need to do is, at the top of your code, add
Dim clWhite, clRed, clWindow

etc, so that you declare each variable ready to be assigned later on.

Regards,

Rob.
0
 

Author Comment

by:misgroupee
ID: 24380529
I absolutely agree this would solve the problem, however it is not my application and I have no idea what  values these variables should be assigned.

The code is not assigning these variables values, they already hold values and are being used to assign properties to existing controls.  That is why I think these are embedded in Windows somewhere, just don't exist in Windows 7.

I attached a Code snippet to be clear what is going on.  Each of the variables beginning with cl are not declared anywhere in the code, yet function just fine in WinXP, Server 2003 and Vista.
Sub OnStatusChange(Sender)
    Select Case Sender.Text
           Case Localize("Open")  'DNL
                Sender.Color = clRed
                Sender.FontColor = clWindow
           Case Localize("In Process")  'DNL
                Sender.Color = clYellow
                Sender.FontColor = clBlack
           Case Else
                Sender.Color = clWhite
                Sender.FontColor = clBlack
    End Select
End Sub

Open in new window

0
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 24380667
Is this code for RapidQ software?  There is sample code here:
http://rapidq.phatcode.net/include/rapidq.inc

which includes a large list of constants that are clRed, clWindow, etc.  I suggest you add these constant values to your code, and it should work fine.

VBScript isn't really aware of any system variables like those you're using, so I'm quite surprised it originally worked as designed.....seems odd....

Regards,

Rob.
0
 

Author Comment

by:misgroupee
ID: 24381357
It isn't RapidQ, but that is at least a list of the variables that I can attempt to use.

I'll give that a shot, thanks for hunting that down.  I couldn't find anything similar.

Thanks.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 24381534
Great. Thanks for the grade.

Regards,

Rob.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question