[NEWSboard IBMi Forum]

Hybrid View

  1. #1
    Registriert seit
    Nov 2001
    Beiträge
    170

    Angry VB-Script aus ClientAccess

    Hallo @all,

    ich versuche, aus der ClientAccess-Emu ein Macro aufzurufen das wiederum ein WindowsScripting-Programm Test.vbs aufruft.
    Das funktioniert auch, nur mein Problem ist die Parameterübergabe.

    autSystem.Shell "Test.vbs", "4711"

    funktioniert, '4711' wird übergeben. Aber bei

    dim Zeichen
    Zeichen = "4711"
    autSystem.Shell "Test.vbs", Zeichen

    wird die Variable 'Zeichen' als Parameter nicht übergeben.
    Das Programm Test.vbs erhält einfach keine Parameter
    (Parameterzahl = 0) !

    Kennt das Problem jemand und kann mir helfen ?

    Vielen Dank im Voraus

    Holger Lossin

  2. #2
    Registriert seit
    May 2002
    Beiträge
    2.643

    Makro Problem

    Hallo Holger,
    ich glaube da hilft Dir dies weiter:

    Problems with Playing a PC5250 Visual Basic Macro
    Incident Summary

    Problem Summary:
    When playing a Visual Basic macro in PC5250, it terminates before the end of the script.

    Resolution:
    The IBM OS/400 command being called in the macro contained a double quotation mark ( " ) before the end of the script. Because a Visual Basic macro automatically places a double quotation mark ( " ) at the beginning and ending of the command, it was interpreting the double quotation mark ( " ) in the middle of the command as the end of script and terminating it. Record the macro as a Macro File rather than a VBScript file, or remove the parameter in the OS/400 command that contains the double quotation mark ( " ).

  3. #3
    Registriert seit
    Nov 2001
    Beiträge
    170
    Hallo,

    danke für die Antwort. Die nützt mir aber leider nix.
    Ich habe das Zielprogramm jetzt extra auch in einen
    Parameter gesteckt, damit im eigentlichen Aufruf kein " steht :

    dim Zeichen
    dim Programm
    Zeichen = "4711"
    Programm = "Test.vbs"
    autSystem.Shell Programm, Zeichen

    Das Programm Test.vbs wird zwar aufgerufen, aber es wird
    immer noch kein Parameter übergeben.

    Holger

  4. #4
    Registriert seit
    May 2002
    Beiträge
    2.643

    VB Script

    Hallo Holger,
    laut dem IBM Dokument muss es aber mit dem Parameter gehen:

    Calling another Program from within VBScript Macro: PCOMM now supports starting an application file from within a
    VBScript. To accomplish this a new automation object has been introduced. autSystem is the new object and Shell
    is the new method.
    The prototype is as follows:
    function autSystem.Shell "ExeName",["Parameters"],[WindowStyle] as long
    Parameters :
    ExeName - String; the path and filename to the executable file.
    Parameters - String, optional; any parameters you wish to pass on to
    the application
    WindowStyle - Integer, optional; the window style that you want the
    application started as.
    The valid values are:
    AUTSYS_SHOW = 1 - show normal with focus
    AUTSYS_SHOWMINIMIZED = 2 - show minimized with focus
    AUTSYS_MAXIMIZE = 3 - show maximized
    AUTSYS_SHOWNA = 4 - show normal without focus
    AUTSYS_MINIMIZE = 5 - show minimized without focus
    The default is AUTSYS_SHOW.
    Return:
    long - If the value is less than 32 it indicates an error has occured.
    example: to run notepad from within a VBScript
    autSystem.Shell "Notepad.exe", "c:\test.txt" , 1
    This will start notepad with the file c:\test.txt loaded in a Normal window with focus.

  5. #5
    Registriert seit
    Nov 2001
    Beiträge
    170
    Hallo,

    diese Info habe ich in dieser Form auch.
    Und mit der direkten Parameterübergabe ohne Variablen funktioniert das ja auch wie beschrieben.
    Aber halt nicht mit Variablen. Und wo ich den Return-Werte herkriegen soll weiß ich auch nicht.
    Wenn ich sage
    RetWert = autSystem.Shell Programm, Zeichen, 1
    läuft der Script auf Fehler :
    Anweisungsende erwartet

    Den aktuellsten Servicepack für CA habe ich übrigens drauf.

    Holger

  6. #6
    Registriert seit
    Feb 2001
    Beiträge
    20.696
    Zuweisungen erfolgen als Funktion:

    RetWert = autSystem.Shell(Programm, Zeichen, 1)
    Dienstleistungen? Die gibt es hier: http://www.fuerchau.de
    Das Excel-AddIn: https://www.ftsolutions.de/index.php/downloads
    BI? Da war doch noch was: http://www.ftsolutions.de

Similar Threads

  1. ClientAccess V.5.2 Startet nicht
    By Cyrex in forum NEWSboard Windows
    Antworten: 19
    Letzter Beitrag: 22-11-06, 09:33
  2. timeout bei ClientAccess / Mocha
    By cbe in forum IBM i Hauptforum
    Antworten: 5
    Letzter Beitrag: 17-11-06, 22:11
  3. ClientAccess Druckersession
    By ath in forum NEWSboard Drucker
    Antworten: 4
    Letzter Beitrag: 05-09-06, 12:58
  4. Script funktioniert nach Releasewechsel auf V5R4 nicht mehr.
    By ratinger in forum IBM i Hauptforum
    Antworten: 1
    Letzter Beitrag: 30-06-06, 10:39
  5. Übergabeparameter im CL Script
    By bo1 in forum IBM i Hauptforum
    Antworten: 3
    Letzter Beitrag: 23-06-06, 15:00

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • You may not post attachments
  • You may not edit your posts
  •