Normal Topic my Subroutine not work anymore (Read 674 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
my Subroutine not work anymore
Aug 14th, 2012 at 2:57pm
Print Post Print Post  
I have installed sesame 2.5.3 . but unfortunately a subroutine does not work anymore.

Here is my subroutine:
Subroutine GET_DOC()
var vTemp as String
var n as Int

IF Not fileexists("C:\sesame2\ichbinhier.txt") then

vList = @ServerListDirectory(vpath)
else
vList = @LocalListDirectory(vPath) 

// Isolate subfolders (items that have no "." in them)
vFolders = @SearchStringArray(vList, "/..\...")

vTemp = ""

// Add boldface and "+" sign to folder names
For n = 1 to @CountStringArray(vFolders)
     vTemp = @AppendStringArray(vTemp, "@b" + "+" + @AccessStringArray(vFolders, n))
Next

vFolders = vTemp

vFileTypes = @Replace(vExtensions, ".", "...")

// Isolate document type filenames
vDocs = @SearchStringArray(vList, vFileTypes)
vDocs = @SortStringArray(vDocs, 0)

PopupSelectPosition(4, @XPos(ThisElement), @YPos(ThisElement))

If vFolderFlag = 1      // User selected a subfolder
{
     vItem = @PopupChoiceList("@b[BACK]" + ";" + vFolders + ";" + vDocs,"Select FOLDER or DOCUMENT")
     vFolderFlag = 0
}
Else
{
     vItem = @PopupChoiceList(vFolders + ";" + vDocs, "Select FOLDER or DOCUMENT")
}

If vItem = "@b[BACK]"
{
     SetStringArraySeparator("\")
     vPath = @TrimStringRight(@ReplaceStringArray(vPath, "",      @CountStringArray(vPath)), "\")
     RestoreStringArraySeparator()
     If @Instr(vPath, "\") > 0 And vPath <> vStartPath Then vFolderFlag = 1
     GET_DOC()
}
Else If vItem <> ""
{
     // For .doc or .docx
     If @FindStringArray(vExtensions, @Right(vItem, 4)) < 0 and @FindStringArray(vExtensions, @Right(vItem, 5)) < 0
     {
           vFolderFlag = 1
           vPath = vPath + "\" + @Replace(vItem, "@b+", "")
           GET_DOC()
     }
     // user selected a document file
}

End Subroutine
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: my Subroutine not work anymore
Reply #1 - Aug 14th, 2012 at 5:47pm
Print Post Print Post  
Hello Amor,

What is vPath set to when this subroutine is called?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: my Subroutine not work anymore
Reply #2 - Aug 14th, 2012 at 5:57pm
Print Post Print Post  
Hello Ray-

vPath="F:\Sesame2\Data\"
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: my Subroutine not work anymore
Reply #3 - Aug 14th, 2012 at 6:02pm
Print Post Print Post  
Hello Amor,

Try: vPath="F:\Sesame2\Data"

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: my Subroutine not work anymore
Reply #4 - Aug 14th, 2012 at 6:10pm
Print Post Print Post  
Thank you Ray.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged