Solved

Windows 7 variable undefined error

Posted on 2009-05-13
5
384 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 500 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 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