Loading ...
Sorry, an error occurred while loading the content.
 

Re: Arrays and OpenFile

Expand Messages
  • Hugo Paulissen
    Hi Chris, - I m afraid I do not really folow your intentions, but you have a $ where you should use a % (common error ;-)... ^!Set $counter%=^%Array0% should
    Message 1 of 3 , Jun 22, 2005
      Hi Chris,

      - I'm afraid I do not really folow your intentions, but you have a $
      where you should use a % (common error ;-)...

      ^!Set $counter%=^%Array0%
      should be
      ^!Set %counter%=^%Array0%

      Your variable was not defined.


      - Personally I'd omit the spaces in these lines as well...

      ^!If ^%counter% = 0 end


      - What can be of help is to put
      ^!SetDebug ON
      at the beginning of the clip...

      Hugo


      >
      > ---- Clip
      > :wizard_start
      > ^!Set %Dir%=^?{(T=D)Directory=^$GetShellFolder(Personal)$};
      > %List%=^?{(T=M;H=15)File List}
      > ^!ifCancel exit
      > ^!if 0 = ^$IsEmpty(%List%)$ continue ELSE end
      >
      > :continue
      > ^!Set
      > %List%=^%Dir%Company^$StrReplace(^%NL%;.html^%NL%^
      > %Dir%Company;^%List%;True;True)$.html
      > ^!SetListDelimiter ^%NL%
      > ^!SetArray %Array%=^%List%
      > ^!Set $counter%=^%Array0%
      >
      > :loop
      > ^!If ^%counter% = 0 end
      > ^!Set %line%=^%Array%^%counter%%
      > ^!Open ^%Dir%^%line%
      > ^!Dec %counter%
      > ^!GoTo loop
      > :end
      >
      > Any suggestions on whats wrong here.
      >
      > Thanks
      > Chris
    • cjangrycloud
      Thanks for pointing those errors out. It turns out the real problem was with the array indexing. ^!Set %line%=^%Array%^%counter%% ^ not needed The now working
      Message 2 of 3 , Jun 22, 2005
        Thanks for pointing those errors out. It turns out the real problem
        was with the array indexing.

        ^!Set %line%=^%Array%^%counter%%
        ^
        not needed

        The now working clip is as follows

        :start
        ^!Set %prefix%=SomeCompany; %suffix%=.html
        ^!Set %directory%=^?{(T=D)Directory=^$GetShellFolder(Personal)$};
        %List%=^?{(T=M;H=15)File List}
        ^!ifCancel exit
        ^!IfTrue ^$IsEmpty(%List%)$ end ELSE continue
        :continue
        ^!Set
        %List%=^%directory%^%prefix%^$StrReplace(^%NL%;^%s
        uffix%^%NL%^%directory%^%prefix%;^%List%;True;True)$^%suffix%
        ^!SetListDelimiter ^p
        ^!SetArray %Array%=^%List%
        ^!Set %counter%=^%Array0%
        :loop
        ^!If ^%counter%=0 end
        ^!Set %line%=^%Array^%counter%%
        ^!Open ^%line%
        ^!Dec %counter%
        ^!GoTo loop
        :end

        I do the updates for a rather large number of product description
        pages. I use an excel spreadsheet to keep track of which pages belong
        to different catagories. Using this clip I can just copy a range of
        model numbers from the spreadsheet, pop them into the clip and it
        opens all the corresponding files that match the pattern of :

        SomeCompany"ModelNumber".html


        Thanks again for your help.


        --- In ntb-clips@yahoogroups.com, "Hugo Paulissen"
        <hugopaulissen@s...> wrote:
        > Hi Chris,
        >
        > - I'm afraid I do not really folow your intentions, but you have a
        $
        > where you should use a % (common error ;-)...
        >
        > ^!Set $counter%=^%Array0%
        > should be
        > ^!Set %counter%=^%Array0%
        >
        > Your variable was not defined.
        >
        >
        > - Personally I'd omit the spaces in these lines as well...
        >
        > ^!If ^%counter% = 0 end
      Your message has been successfully submitted and would be delivered to recipients shortly.