#1067 incorrect char x'7B' - chicken-lips-bracket

v4.0.1
closed
nobody
5
2012-08-14
2012-04-12
Gscholl
No

oorexx-vers. 4.0.1, Win XP SP3, Testprogram from distribution

while testing oorexx\samples\ole\wmi and running program osinfo the following error-msg is issued: error 13.1, invalid char in program x'7B'

looking into the program I found out:
x-the chicken-lips bracket causes the error
WMIObject = .OLEObject~GetObject("Winmgmts:"{impersonationLevel=impersonate}")
/ obtain a collection of all Win32_OperatingSystem objects /
objects = WMIObject~InstancesOf("Win32_OperatingSystem")

When running with the following changes - pgm works fine..

pari = "{impersonationLevel=impersonate}"
WMIObject = .OLEObject~GetObject("Winmgmts:"pari)
/ obtain a collection of all Win32_OperatingSystem objects /
objects = WMIObject~InstancesOf("Win32_OperatingSystem")

What's might be the cause for this 'feature' ?? - Thanks

Discussion

  • Rick McGuire

    Rick McGuire - 2012-04-12

    Bracket characters are not a valid Rexx program character outside of a literal string, so that is the appropriate syntax error. It's not clear to me what your intentions were on the original statement, but that is NOT a syntactically correct Rexx statement. Changing that line to

    WMIObject = .OLEObject~GetObject("Winmgmts:impersonationLevel=impersonate}")

    Will give you the same result as the second version.

     
  • Gscholl

    Gscholl - 2012-04-12

    Rick,
    I tried the one suggested - and this also fails - same reason.
    WMIObject =
    .OLEObject~GetObject("Winmgmts:impersonationLevel=impersonate}")

    I took away the closing chicken-lips and the result is a .nil-object being returned.

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-04-12

    Looking at the sample as distributed in the 4.0.1 release, I see it has:

    / obtain a WMI object /
    WMIObject = .OLEObject~GetObject("WinMgmts:{impersonationLevel=impersonate}")

    which is correct.

    Not sure how you ended up with:

    WMIObject = .OLEObject~GetObject("Winmgmts:"{impersonationLevel=impersonate}")

    but someone must have edited the line after installation.

    The program runs correctly on my system.

    This:

    .OLEObject~GetObject("Winmgmts:impersonationLevel=impersonate}")

    is not correct. You need both brackets. The whole of argument one needs to be in quotes. Like this:

    .OLEObject~GetObject("WinMgmts:{impersonationLevel=impersonate}")

     
  • Gscholl

    Gscholl - 2012-04-13

    I finally found out that one of my machines had a corrupted WMI-environment, so this also leads to unexpected errors.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks