Link to home
Start Free TrialLog in
Avatar of misgroupee
misgroupee

asked on

Windows 7 variable undefined error

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?
Avatar of RobSampson
RobSampson
Flag of Australia image

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.
Avatar of misgroupee
misgroupee

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Great. Thanks for the grade.

Regards,

Rob.