Engineering Requirements Management

 View Only

Temporary Stream variable definition

  • 1.  Temporary Stream variable definition

    Posted Tue March 14, 2023 07:22 AM

    Hello All, 
    I have this testFunc that uses a CSV File opened as a stream, 
    This function needs the original CSV file for every module it runs on (running the function on a module using folder_iterate() function).
    I want some sort of temp variable to store the Out stream data when the func is running for each module 
    I tried defining a new stream "tempStream" and did " tempStream = out" but this didn't work.
    Any ideas how can I achieve this please? I don't want to open the Stream everytime the function runs, because it's time consuming.

     

    fs = fileName (mainWindow,"Path to CSV")
    file = get(fs)
    Stream out 
    out = read file

    void testFunct(Module module){
        USING THE OUT FILE
    }
    ....

    iterate_folder(FOLDER) // Runs the testFunct on a folder

     


    Thank you in advance & best regards, 
    Khalid



    ------------------------------
    Khalid KASSI
    ------------------------------

    #EngineeringRequirementsManagement
    #Sustainability