Small trick for add-in documentation/help text to appear in _this.display

For tips, questions and general information about writing Add-ins, how to package them, and how to submit them to EViews for publication.

Moderators: EViews Gareth, EViews Moderator

mamo
Posts: 87
Joined: Wed Nov 07, 2012 9:11 am

Small trick for add-in documentation/help text to appear in _this.display

Postby mamo » Wed May 16, 2018 1:15 am

Dear community,

this is just to share with you a minor trick to enhance the documentation of add-ins.

An add-in documentation text file can be made to appear in the own window of the object the add-in is registered to once the user provides a string such as "help" or just "?" as the first argument when calling the add-in from the command line, i.e., "myequation.myaddin ?". See program sniplet below.

Best, mamo

Code: Select all

' ... other parts of the addin programme

%addindoc=@addinspath+"\addindir\addinname.txt"  'path of the add-in documentation text file
%helpargs="help ?"  'one of these strings as first argument would trigger the display of the help text
%tmptxt=_$tmptxt      'name for the temportary text object

%arg1=@word(lower(@trim(%args)), 1)
if @wfind(%helpargs, arg1)  then
   text {%tmptxt}
   {%tmptxt}.append(file) %addindoc
   _this.display {%tmptxt}
   delete {%tmptxt}
   stop
endif   

' ... other parts of the addin programme

Return to “Add-in Writing area”

Who is online

Users browsing this forum: No registered users and 0 guests