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

Re: [jasspa] Help with a macro

Expand Messages
  • Thomas Hundt
    It s &sin not the other way around! ... -- Thomas Hundt
    Message 1 of 3 , Oct 8, 2004
    • 0 Attachment
      It's

      &sin <string you're looking for> <string you're searching>

      not the other way around!



      Salman Khilji wrote:

      > I am trying to write a macro that does the following:
      >
      > Given the name of a buffer such as GraphView.cpp,
      > strip it off the extension and insert in the buffer
      > the following string at the current position:
      >
      > GraphView::
      >
      > So I search in the buffer name of a '.' character.
      > The problem is that the &sin function always returns
      > 0.
      >
      > Here it is
      >
      > define-macro function_separator
      > set-variable %index &sin $buffer-bname "."
      > !if &equal %index 0
      > set-variable %classname $buffer-bname
      > !else
      > set-variable %classname &lef $buffer-bname
      > %index
      > !endif
      > insert-string %classname
      > insert-string "::"
      > !emacro


      --
      Thomas Hundt
    Your message has been successfully submitted and would be delivered to recipients shortly.