NetTalk Central

Author Topic: .ChangeDir()  (Read 15845 times)

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
.ChangeDir()
« on: August 27, 2007, 12:39:32 PM »
Hello folks,

this is from the Nettalk.tpl.

BreakInDirToQ routine
  data
RLoc:y      long
RLoc:z      long
  code
!-- This routine makes a queue out of the subdirs where to place the logfiles.
!-- This is only necessary when the directory does not exist and needs to be created.
    RLoc:y = 0
    loop
      RLoc:z = RLoc:y + 1
      RLoc:y = instring('/',%FTPGroupPar.FTPDir,1,RLoc:z)
      if (RLoc:y = 0) or ((RLoc:y > instring('\',%FTPGroupPar.FTPDir,1,RLoc:z)) and instring('\',%FTPGroupPar.FTPDir,1,RLoc:z)) then
        RLoc:y = instring('\',%FTPGroupPar.FTPDir,1,RLoc:z)
      end
...

What makes me wonder is why there is  instring('/', but later its instring('\',,

I am just curious ;-)

Wolfgang


seancameron

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • CapeSoft Software
Re: .ChangeDir()
« Reply #1 on: September 20, 2007, 11:24:11 PM »
Hi Wolfgang,

It checks for both, first for a forward slash and then for a backslash if there is no forward slash. Note that it will break if you mix forward slashes and backslashes in a single directory specification, but that should never happen.

Regards,

Sean Cameron
CapeSoft
Work Smarter, Not Harder
Sean Cameron
CapeSoft
www.capesoft.com

Work Smarter, Not Harder