Results 1 to 9 of 9
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Storte variable for next use... (2000 sr 1)

    I don't understand. I don't know how VAR_SESSION is declared (if at all), but in the first procedure, VAR_SESSION is set to a string value, while in the second procedure, it is an object. What do you want to store and how do you want to use it?

  2. #2
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Storte variable for next use... (2000 sr 1)

    sorry, string for all

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Storte variable for next use... (2000 sr 1)

    Can you explain where and how you want to use the value in the second procedure?

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Store variable for next use... (2000 sr 1)

    I have modify my post...
    My idea is to store the avriable and use in Sub SET_PRN( dim VAR_SESSION as string)

    i get this variable from a txt file with (VAR_SESSION):

    Sub LEGGI_STAMPANTE_EXTRA()
    Dim RIGA As String
    iFile = FreeFile()
    vFile = ("C:PROGRAMMIATTACHMATEE!E2KSESSIONS3270.ELF")
    Open vFile For Input As #1
    While Not EOF(1)
    Line Input #1, RIGA
    If Len(Trim(RIGA)) > 0 Then
    If InStr(Mid(RIGA, 92, 3), "PRT") > 0 Then
    var_ID_PRN = Mid(RIGA, 81, 14)
    VAR_SESSION = Mid(RIGA, 1, 12)
    Close #1
    Call SET_PRN
    Exit Sub
    End If
    End If
    Wend
    End Sub


    and i would want to store for next use in:

    Sub SET_PRN()
    Dim System As Object
    Dim Sessions As Object
    Dim QPads As Object
    Dim QPad As Object
    Set System = CreateObject("EXTRA.System")
    Set Sessions = System.Sessions
    Set VAR_SESSION = Sessions.Open("C:PROGRAMMIATTACHMATEE!E2KSESSIONS" & var_ID_PRN & ".EPP")
    VAR_SESSION.Close
    Call STAMPA_FILE
    End Sub

    how make this?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Store variable for next use... (2000 sr 1)

    You cannot do it this way, since you already use VAR_SESSION as an object variable in SET_PRN. You still haven't answered my question where and how you want to use the string variable VAR_SESSION from LEGGI_STAMPANTE_EXTRA in SET_PRN.

  6. #6
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Store variable for next use... (2000 sr 1)

    Sorry, from LEGGI_STAMPANTE_EXTRA to SET_PRN in string mode....

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Store variable for next use... (2000 sr 1)

    Would you please explain exactly and in detail what you want? <img src=/S/please.gif border=0 alt=please width=31 height=23>

  8. #8
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Store variable for next use... (2000 sr 1)

    ... in the first macro a get the variable VAR_SESSION from a txt file.
    After this opearation the macro end.
    Well, in the first macro before the end is present a Call SET_PRN.
    In the macro SET_PRN is present a comand to call another application:

    Set VAR_SESSION = Sessions.Open("C:PROGRAMMIATTACHMATEE!E2KSESSIONS" & var_ID_PRN & ".EPP")

    In this case VAR_SESSION is a string...

    Naturally when the first macro ended the value of variable VAR_SESSION is cleared from the system and not is possible to use in the macro Sub SET_PRN()

    I have seen in another part of this forum that is possible to store a variable in the () of macro for next use...
    Or is possible to store in a Const or in a Global param?...

    In effect the txt file not is the same for every pc... Is a similar .ini file

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Store variable for next use... (2000 sr 1)

    You STILL don't tell us where EXACTLY you want to use the value. <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15>
    Do you mean that the value of VAR_SESSION from the first macro should be used as var_ID_PRN in the second macro?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •