Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Windows 7 variable undefined error

Posted on 2009-05-13
5
Medium Priority
?
389 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 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