Additional Feature like in Eclipse

Hi,

i’m searching for a additional window beside the editorwindow which gives me an overview of the Subroutines and variable Definitions from the actual subprogram or program. If someone knows like the “Outline” window at Eclipse. It would be Great to get to the Line of Code by Clicking to needed Statemend within the Window.

Possible Window:

Define Data
±parameter
| ±pabc
| ±pdef123
±local
| ±labc
±inlines
| ±01 group
| ±01 var1
end-define
Subroutines
±makesomething
±makesomeother
±notanothersubroutine

Greetings
Sascha Wiegandt

This is an interesting feature with Eclipse. There are many other very good features in Eclipse as well. We are looking at Eclipse and will decide on possible features in Natural Studio when the upcoming release Natural 6.2 is out of the door.
Regards,
Michael

Here is a tool that I have made, which can do some of the things you are asking for. But it is modal!

I have try to make a plug-in, but I can not get the “jump to”-feature to work, and I can’t get refresh do work. But is not modal. Plug-in not sent.

Note: Code and some messages are in Danish.

Ups. Attachment was missing.

I get “Sorry, you have reached your maximum Upload Quota Limit of 5 KB”

Zip file size: 48KB.

My quota limit for attachments is now 50KB, sow I will try again.
ARATOOL.zip (47.7 KB)

Tell me more about the refresh issue! Regards, +o:-]

Your tool works on most programs but try this ( :twisted: can be stowed without errors):

DEFINE DATA LOCAL 
1 #DYNARRAY (A/*) dynamic
1 #A(A1/*  ) 1 EMPLOY-VIEW VIEW OF EMPLOYEES
  2 NAME
  2 SALARY (5)
  1 END-DEFINE (I4)
  1 CALLNAT (A8) INIT <"HUGO">
END-DEFINE
*
CALLNAT CALLNAT
*
PRINT "HALLO /* DOLLY" ; CALLNAT "HUGO" RESET #A(/* ) #dynarray(*)
*
R. READ EMPLOY-VIEW WITH CITY = 'MADRID'
  DISPLAY NAME SALARY(R./*) callnat "hugo"
END-READ
*
END

:idea:
:arrow: not every /* is a comment especially inside ( … )
:arrow: a literal may be used as variable name

I have the following code in ONNFY-N
IF NOTIFICATION = NOTIFY-REFRESH
RESULT := 1
SEND ‘Messagebox’ TO #STUDIO
WITH ‘RESULT := 1’ ‘(NTY)’
END-IF

and I expected that setting RESULT := 1, would generate a call to ONGDT-N. But it don’t. I get the Messagebox, but not the call to ONGDT-N.

I can’t find a way to modifi the content of my treeView.

Hehe - you’re quite cruel to my Collegue Allan :wink:

Noone uses such provocative variable names at our department. Anyway I thought that Software AG had put stoppers against reserved words in variable names into the compilers.

Henrik.

I know there are some programs which it can’t handle, but as you wrote it can handle most programs.

Do you have program like that i production? :slight_smile:

Try your code in SPoD. SAG are having problems with it too :slight_smile:

@Allan:
Do you pass a refresh object with the Refresh method? Anyway, you should watch for the GetChildren method being called for each node concerned by the refresh, which gives you the opportunity to pass a new child list and let Natural Studio update the tree. The fact that you receive the NOTIFY-REFRESH notificiation at all indicates at least that you have already taken the first hurdle: ‘Automatic refresh’ is turned on in Tools/Options/Workspace’.
Regards, +o:-]

@Allan Rasmussen:

  • Yes, I have seen such code - not only once, especially on old programs. :frowning:
  • May SpoD have the same problem as your tool - make is correct, which will take quite a long time or make it quick, dirty and fast :roll:

@Henrik Hermansen:

  • No there are almost no restrictions on using reserved words.
  • I know it’s quite complicated to have a parser on the Natural syntax doing everyting right or even almost everyting.
  • But way not talk about the restrictions and pitfalls to avoid wrong expectations…

I don’t understand. I don’t call the Refresh method. The notify method gets call by Natural Studio, when window focus is changed and source i the program editor gets saved. The object in OBJECTPARAM is my ThreeView.
Do I have do call the Refresh method of the Natural Studio, in my notify method?

The GetChildren method does not get called.

I got it to work :D. The following code works. If I don’t use the #REFRESH-ACTIVE variabel SPoD loops :slight_smile:

  
IF NOTIFICATION = NOTIFY-REFRESH
  IF NOT #REFRESH-ACTIVE
    #REFRESH-ACTIVE := TRUE
    SEND 'Refresh' TO #STUDIO
    #REFRESH-ACTIVE := FALSE
    RESULT := 1
  END-IF
END-IF

I tried to use the following to avoid looping, but it didn’t make a deference.

  
COMPRESS '<ritem>'
  '<rguid>0025E718-EB5A-4DCC-B691-5603FB123456</rguid>'
  '<rtype>30000</rtype>'
  '<rkey>ONNFY-N PLUG-IN</rkey>'
  '<rinfo></rinfo>'
  '</ritem>'
  INTO #TEKST-DYN LEAVING NO
SEND 'Refresh' TO #STUDIO
  WITH #TEKST-DYN

How I am only missing to get follow code work


#ACTION := 'GOTOLINE'
#START-LINE := VAL(#LINE-NUMBER)
#WITHLINENO := TRUE 
RESET #RESPONSE2 #ERR-TXT2
*
CALLNAT 'USR6004N' PARM-AREA
*
IF #RESPONSE2 <> 0
  COMPRESS '#RESPONSE:' #RESPONSE ' #ERR-TXT:'
    #ERR-TXT INTO #TEKST
  SEND 'Messagebox' TO #STUDIO
    WITH #TEKST 'Natural studio plug-in'
END-IF

I get “#RESPONSE: 9 #ERR-TXT: Program editor not active and/or no active window”, then the code is run.

[/code]

No, you should definitely not do this. The notification is just sent in order to inform you that a Refresh is currently taking place and to let you decide if you want to let your views take part in this, not to make you trigger a new (then recursive) Refresh. My question raised from my wrong understanding that “I don’t get the Refresh to work” meant that you are triggering the Refresh yourself by calling the Refresh method.

In this case I presume that by comparing the object currently being refreshed Natural Studio assumes that your tree nodes are not concerned by the ongoing Refresh. It is hard to decide if this is right or wrong without having more detail about the plug-in. If you like, upload it and let me have a short look.
[/quote]

Better don’t do this. The notification indicates that there is a Refresh going on. It should be sufficient to respond with 1. I could possibly tell what’s wrong if you could upload the code.
Regards, +o:-]

Here is my Plug-in. I have cleaned up at bit, but the code still not easy to read and it is in Danish. Hope it will work for you.

Note: PLUGIN.ZIP contains a new version of TY-SUBRN, which can handle weihnachtsbaer’s code example.
PLUGIN.zip (71.2 KB)

@Allan: Thanks for the fine example. Well, I had to add a few things to make the refresh work, but it’s not too hard.

First of all, you should let Natural Studio know that the root node of your tree actually represents a built-in object (say a Program or what else). Otherwise the Refresh mechanics does not know that your tree node has something to do with the object currently being saved. I achieved this by changing the call to the Open method in ONCMD-N to
SEND ‘Open’ TO #MNATAUTOOBJECTTREES
WITH 30000 #TEKST-DYN #TEKST
6X 1009 ‘TESTCLS A1 101 99’
Obviously this works only if you incidentally have a Program TESTCLS in Library A1 on DBnr 99 and Fnr 101 open in the editor, but it should be sufficient to indicate the general approach. This has the nice side effect that Natural Studio treats this node as a Program in any respect, means it shows the right icon and context menu.

Second, I respond to the REFRESH notification in ONNFY-N simply with 1 and do nothing else.
IF NOTIFICATION = NOTIFY-REFRESH
RESULT := 1
END-IF

Third, it is safer to use the original method PDAs from SYSEXPLG (having SYSEXPLG as a steplib) rather that having private copies of the PDAs in the plug-in library. Something seemed to be wrong with the copies (I did not pursue this further), in any case it worked only correctly after I used the original one at least for the OnNotify method.

Having done all this, I nicely received the GetChildren call whenever I saved the source in the editor.

Kind regards, +o:-]