2 Replies Latest reply: Jan 2, 2014 8:22 AM by Colin Albert RSS

    Error in calling a subroutine

    Boris Kacevich

      Hi all,

       

      I have written this Sub in a sheet:

       

      sub FilesLoad(Root,FileName,RunIdList)

        let vTableName = '$(FileName)';

        let vRunList = '$(RunIdList)';

        let vConcatenate = ;   

        sub ScanFolder(Root)           

              for each FoundFile in filelist( Root & '\*.csv') 

        if(match(subfield('$(FoundFile)','\',-3), '$(vRunList)')) then

        if (match(upper(left(mid('$(FoundFile)', index('$(FoundFile)', '\', -1) +1), len(mid('$(FoundFile)', index('$(FoundFile)', '\', -1) +1)) -19)),'$(vTableName)')) then 

                      $(vTableName):   

                      $(vConcatenate)   

                      LOAD *  

                      FROM '$(FoundFile)' (txt, codepage is 1252, no labels, delimiter is '|', msq);   

                      endif

                      Set vConcatenate = Concatenate;

                  ENDIF    

               next FoundFile  

          for each SubDirectory in dirlist( Root & '\*' )   

              call ScanFolder(SubDirectory)   

          next SubDirectory

          STORE '$(vTableName)' into 'C:\test\$(vTableName).qvd' (qvd);   

        end sub

        call ScanFolder(Root)

      end Sub

      then in the previous script I call this sub:

       

      let vRoot = 'C:\decisioning\log\dcs';

        call FilesLoad('$(vRoot)','DCS_META_DATA','1')

      and I get:

       

      Script line error:

      call FilesLoad('C:\decisioning\log\dcs','DCS_META_DATA','1')

       

      Can someone assist?

       

      thanks,

       

      Boris