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

Re: [Clip] File->Variable Problem

Expand Messages
  • Jody
    Hi ste-m@clara.net, I m in a rush to get out the door so I cannot test, but see if the SetCode Code command will help. ^!SetCode %VariableName%=Value (added in
    Message 1 of 4 , Aug 4, 2001
    • 0 Attachment
      Hi ste-m@...,

      I'm in a rush to get out the door so I cannot test, but see if
      the SetCode Code command will help.

      ^!SetCode %VariableName%=Value (added in v4.84)
      Similar to the ^!Set command, but assigns the value without
      interpreting ^?{} prompts and Clip tokens like ^P, ^T, ^&, ^#,
      etc. However, variables and functions used in the assigned value
      are evaluated normally. You cannot set multiple variables with
      this command.

      >H="Insert Text From File Via Variable"
      >^!Set %TEXT%=^$GetFileText("C:\testfile.txt")$
      >^!InsertText ^%TEXT%
      >To my mind this should simply insert the text contained in
      >testfile.txt at the current cursor position.

      >It truncates the file upon insertion.


      Happy Clip'n!
      Jody

      http://www.notetab.net

      Subscribe, UnSubscribe, Options
      mailto:Ntb-Clips-Subscribe@yahoogroups.com
      mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
      http://www.egroups.com/group/ntb-clips
    • Alan C.
      Hi, ... At times I ve had use (resort to) what i call hard coded var to do this. not really hard coded but what it really is: instead of traditional
      Message 2 of 4 , Aug 4, 2001
      • 0 Attachment
        Hi,

        >around. Basically I'm looking to get a small(ish) text file into a
        >variable and do some list processing on it without having to load the
        >file directly into NoteTab and process it.

        At times I've had use (resort to) what i call "hard coded" var to do
        this. not really hard coded but what it really is: instead of traditional
        computer's memory memory variable it's a (written to) "disk file variable"

        H="FORWAD"
        ^!Set %open%=_~Open
        ^!Set %sti%=_~SetTopicIndex
        ^!Set %jmp%=_~Jump
        ;
        ^!Set %open%=^$StrReplace(_;^;^%open%;False;False)$
        ^!Set %open%=^$StrReplace(~;!;^%open%;False;False)$
        ;
        ^!Set %sti%=^$StrReplace(_;^;^%sti%;False;False)$
        ^!Set %sti%=^$StrReplace(~;!;^%sti%;False;False)$
        ;
        ^!Set %jmp%=^$StrReplace(_;^;^%jmp%;False;False)$
        ^!Set %jmp%=^$StrReplace(~;!;^%jmp%;False;False)$
        ;
        ^!Deletefile ^$GetScriptPath$mysurf.dat
        ; **************************************
        ; next line writes a diskfile (the variable to do your task)
        ^!TextToFile "^$GetScriptPath$mysurf.dat"
        ;storeit^%NL%^%NL%H="surfnow"^%NL%^%open% "^$GetDocName$"^%NL%^%sti%
        ^$GetTopicIndex$^%NL%^%jmp% ^$GetRow$
        ; Jump to link
        ^!Keyboard Ctrl+H

        H="BACK"
        ^!Toolbar Close Document
        ^!FarClip "^$GetScriptPath$mysurf.dat:"surfnow""

        ----------
        the above is for surfing from an outline then the back clip gets the surfer
        back to a same spot in the outline

        notice the several lines under *******************

        Ntab's SampleCode library a demo of farclip with a .dat file

        Regards. Alan.
      • ste-m@clara.net
        Jody & Alan, Thanks for the help. The ^!SetCode command seems to do the trick nicely. It seems a little odd at first to have two set commands (excluding the
        Message 3 of 4 , Aug 4, 2001
        • 0 Attachment
          Jody & Alan,

          Thanks for the help. The ^!SetCode command seems to do the trick
          nicely. It seems a little odd at first to have two set commands
          (excluding the slightly different one for arrays), but it does give
          you that extra bit of flexibity - which is why I got NoteTab in the
          first place.

          Thanks again.

          Stephen.
        Your message has been successfully submitted and would be delivered to recipients shortly.