Solved

Windows 7 variable undefined error

Posted on 2009-05-13
5
379 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
  • 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now