keyproc folding

This forum should be used for all code folding problems, questions or suggestions. You can also use this forum to request folding support for a new language.
Post Reply
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

keyproc folding

Post by gwgs »

Keyproc folding not working.
Also forms /... folding entire program, not just to next /*
Comments // folding entire program too

If comments // in program, folding options after it are disabled until next form /... /* combination.
eg, using sample code.
can fold forms /sampleform, /header, /body
there are 3 separate comment lines early on after the /*
all folding is disabled until /sampleform2 & /*

Sorry for the delay in posting, I thought I posted last week but it didn't go through for some reason (probably didn't post it after previewing it).

Grant
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Keyproc folding not working.

I downloaded the xFolder.dll found here: http://www.zeusedit.com/z300/xFolderPF.zip

Then using your sample code this dll folds this code:

Code: Select all

 keyproc key.escape
    abort
 return

 keyproc key.field
    backfield
 return

 keyproc key.return
    ifwindow eq testform2.1 begin
       clear tsetfile
       testfile.code=testfile.1
       find eq testfile by index.1
       [found] entdisplay testfile
    end
 return
down to this:

Code: Select all

+ keyproc key.escape ... return
+ keyproc key.field  ... return
+ keyproc key.return ... return
Also forms /... folding entire program, not just to next /*

Anys this code:

Code: Select all

  /sampleform 
  
  enter this: __________ 
  
             _[_ all correct? 
  
  /header 
      sample report 
  
  code  description 
  ----------------- 
  /body 
  _____ ___________ 
  /* 
  // include common variables 
  #include common.inc 
  
  // define testind if required 
  #IFNDEF testind 
  indicator testind 
  #ENDIF 
  indicate tesetind false 
  
  // reset teststr or define teststr if required 
  #IFDEF teststr 
  teststr="" 
  #ELSE 
  string teststr 30 
  #ENDIF 
  
  function testfunction string instr returns string 
  integer ctr 
  result="" 
  for ctr from length(instr) to 1 step -1 
  result=result+mid(instr,1,ctr) 
  loop 
  end_function
folds down to this:

Code: Select all

 + /sampleform ... /* 
   // include common variables 
   #include common.inc 
   
   // define testind if required 
   #IFNDEF testind 
   indicator testind 
   #ENDIF 
   indicate tesetind false 
   
   // reset teststr or define teststr if required 
   #IFDEF teststr 
   teststr="" 
   #ELSE 
   string teststr 30 
   #ENDIF 
   
   function testfunction string instr returns string 
   integer ctr 
   result="" 
   for ctr from length(instr) to 1 step -1 
   result=result+mid(instr,1,ctr) 
   loop 
   end_function
Comments // folding entire program too

I'm not sure what you mean by this :?:
If comments // in program, folding options after it are disabled until next form /... /* combination.

Isn't the // just a line comment :?: The folder will ignore anything after the line comment.
eg, using sample code.
can fold forms /sampleform, /header, /body
there are 3 separate comment lines early on after the /*
all folding is disabled until /sampleform2 & /*

Sorry, i'm confused :?

Cheers Jussi
Last edited by jussij on Tue Jun 03, 2008 2:41 am, edited 2 times in total.
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

After doing some more testing I found the following.

Yes keyproc folding works, but the folding bar doesn't show that it can be folded until you edit the sample code around it, then it gets re-detected that it can be folded.

yes // is a line comment, anything after that is a comment

I found that when there is a line coment at column 1, the code folding detection doesn't work except for the forms /.... /* and the begin ... end delimters. All other code folding breaks aren't showing or working until they are re-detected.

Hope that's clearer.


Grant
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

On the code folding of forms and line comments....
using the sample code, when /sampleform is folded, the entire program down to the last 3 comment lines are folded into a single line.
same goes for /header and any // lines that start at column 1

hope that is clearer.

Grant
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Yes keyproc folding works, but the folding bar doesn't show that it can be folded until you edit the sample code around it, then it gets re-detected that it can be folded
For me this is working perfectly. This very strange :?

Which version of Zeus is shown in the help about dialog :?:
I found that when there is a line coment at column 1, the code folding detection doesn't work except for the forms
Again I don't see this :(

For me I can have this code:

Code: Select all

   // define testind if required
   #IFNDEF testind
   indicator testind
   #ENDIF
and it will fold to this:

Code: Select all

  // define testind if required
 + #IFNDEF testind ... #ENDIF
On the code folding of forms and line comments....
using the sample code, when /sampleform is folded, the entire program down to the last 3 comment lines are folded into a single line. same goes for /header and any // lines that start at column 1

Unfortunately I don't see that :? I have update my previous posting to show exactly what I am seeing.

I am not really sure why the folding is working for me and not for you. I would suggest making sure you don't have a stray version of the xFolder.dll floating about.

One thing you could try is editing the xFolder.ini file and add .log to the PowerFlex folder entry. Then if you create a log file and past some Poerflex code into the file it will fold.

This will check to see if the issue is document type related.

Cheers Jussi
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

I have zeus v3.96p
I added log to the powerflex entry in xfolder.ini I still get the same result.
sample.log as below

Code: Select all

/sampleform

enter this: __________

           _[_ all correct?

/header
    sample report

code  description
-----------------
/body
_____ ___________
/*
// include common variables
#include common.inc

// define testind if required
#IFNDEF testind
   indicator testind
#ENDIF
   indicate tesetind false

// reset teststr or define teststr if required
#IFDEF teststr
   teststr=""
#ELSE
   string teststr 30
#ENDIF

function testfunction string instr returns string
   integer ctr   
   result=""
   for ctr from length(instr) to 1 step -1
      result=result+mid(instr,1,ctr)
   loop
end_function

procedure testprocedure string instr
   integer ctr   
   ctr=length(instr)
   while ctr>0
      showln mid(instr,1,ctr)
      ctr=ctr-1
   until ctr=0
end_procedure


   entergroup
      accept sampleform.1  {capslock}
      accept sampleform.2  {checkbox}
   endgroup

   teststr=sampleform.1
   for ctr from 1 to length(teststr) step 1
      showln mid(teststr,1,ctr)
   loop

   switch sampleform.2
      when 1
         showln "YES"
      otherwise
         showln "NO"
   endswitch

   open testfile

   report testfile by index.1
      
      section header
         output header

      section body
         print testfile.code
         print testfile.desc
         output body

#include RPTKEY.inc
   reportend

   showln testfunction(sampleform.1)
         
/sampleform2
   code:        _____
   description: ___________
/*

   enter testfile
      entry testfile.code testform2.1 {capslock}
      entry testfile.desc testform2.2 
   enterend


keyproc key.escape
   abort

keyproc key.field
   backfield
return

keyproc key.return
   ifwindow eq testform2.1 begin
      clear tsetfile
      testfile.code=testfile.1
      find eq testfile by index.1
      [found] entdisplay testfile
   end
return


// general code formating comments:
// there are no case restrictions or strict formating other than syntactical restrictions
// the above code could have been all uppercase, without any indentation

I just created a clean install of Zeus and it works as you describe. once I copied my zconfig folder over it stopped working :( I'll investigate the differences and see if I can find out what's causing it.

Thanks

Grant[/code]
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

I just created a clean install of Zeus and it works as you describe. once I copied my zconfig folder over it stopped working.
If you send me the zConfig files as a zip file attachment I would be happy to take a look what is going wrong ;)

Just use the e-mail button bellow and put the word Zeus in the subject text.

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The reason your comments are not folding correctly is because the Allow nested comments option is checked in the document type setting control ;)

I made some minor changes to the code so you should also get the latest xFolder.dll found here: http://www.zeusedit.com/z300/xFolderPF.zip

Cheers Jussi
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

Thanks Jussi, that was it :D the code folding works great.

Grant
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Grant,

I made some additional minor enhancements to the folder so you should also get the latest xFolder.dll found here:

http://www.zeusedit.com/z300/xFolderPF.zip

Cheers Jussi
gwgs
Posts: 87
Joined: Tue Nov 21, 2006 6:30 pm
Location: Auckland

Post by gwgs »

works well

Thanks Jussi


Grant
Post Reply