Code Folding for Powerflex
Posted: Tue May 27, 2008 5:04 am
Can this language be added to the code folding routines please.
Sample Code:Extensions: .pfx .pfi .pfm .inc
Line Comment: //
Block Comment:
Begin: begin
End: end
Begin: #IF #IFDEF #IFNDEF #IFSAME #ELSE #ELIF #IFCLASS #IFTYPE
End: #ENDIF
Begin: function
End: end_function
Begin: procedure
End: end_procedure
Begin: for // can mix and match
Begin: while // these four cmds
End: loop //
End: until //
Begin: entergroup
End: endgroup
Begin: switch
Begin: when otherwise
End: endswitch
Begin: report
Begin: section
End: reportend
Begin: enter
End: enterend
Begin: #COMMAND
End: #ENDCOMMAND
Begin: constraint
End: end_constraint
Begin: Class
End: end_class
Begin: object
End: end_object
Begin: event
End: end_event
Begin: / at position 1 followed by a-z and other alpha numerics, continues until another / at column 1 but not //
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