Page 2 of 2

Posted: Wed Jan 10, 2007 10:20 am
by Derek
eJan wrote:Thanks Derek!
I have commenteted indenter line:

Code: Select all

;RenameFile(pps,pps+".bak")
Is there a solution to make indentation only (without modifying the source), closing it without msgbox to save changes?
The file that the above line makes is a backup of the original source, unmodified, once you run a tool on a file and reload the file back in (which is what the indenter is doing) then that source is flagged by the IDE as being unsaved and so it will always ask if you want to save.

If you don't rename the source as a backup and save a modified source as the backup instead then it won't get reloaded as the names won't match so I don't really see any other way of doing this, sorry. :(

Posted: Wed Jan 10, 2007 3:14 pm
by eJan
O.K., thanks!

Posted: Tue Jan 16, 2007 9:44 pm
by eJan
Me again. :oops:
How to make it to work with structures?

Code: Select all

  Structure Person
    Name.s
    ForName.s 
    Age.w 
  EndStructure

Code: Select all

Structure Person
Name.s
ForName.s
Age.w
EndStructure

Posted: Wed Jan 17, 2007 9:13 am
by Derek
It should already be working, it does on mine. Just cut and pasted your bit of code above and it worked on that. :?

Posted: Wed Jan 17, 2007 9:43 pm
by eJan
Derek wrote:It should already be working, it does on mine. Just cut and pasted your bit of code above and it worked on that. :?
Unfortunately not, I have added "procedure." to recognize Procedure types but then Structure is not recognized. This is My output:

Code: Select all

Procedure a(a, b, c=2)
  Debug c
EndProcedure

Procedure.s Attach(String1$, String2$)
  ProcedureReturn String1$+" "+String2$
EndProcedure

Structure Window
*NextWindow.Window  ; Points to another window object
x.w
y.w
Name.s[10]  ; 10 Names available (from 0 to 9)
EndStructure
Indenter changes:

Code: Select all

  Data.s "if ","for ","while ","repeat ","procedure ","procedure.","select ","datasection " 
  Data.s "macro ","compilerif ","compilerselect ","structure "
:(

Posted: Thu Jan 18, 2007 11:00 am
by Derek

Code: Select all

DataSection 
  #plus=11 
  Data.s "if ","for ","while ","repeat ","procedure ","select ","datasection " 
  Data.s "macro ","compilerif ","compilerselect ","structure " 

  #minus=12 
  Data.s "endif ","next ","wend ","until ","endprocedure ","endselect ","enddatasection " 
  Data.s "endmacro ","forever ","compilerendif ","compilerendselect ","endstructure " 

  #temp=7 
  Data.s "else ","elseif ","case ","compilerelse ","default ","compilercase ","compilerdefault " 
EndDataSection 
By adding 'Procedure.' you have increased the number of '#plus' finds by one and so 'structure' has fallen off the end, as it were.

If you increase the number in the line above that reads '#plus=11' to 12 that should work.

Basically, count how many keywords you have in each section of data and put it in the variable before each section.

Hope this helps. :)

Posted: Thu Jan 18, 2007 1:29 pm
by eJan
Derek wrote: By adding 'Procedure.' you have increased the number of '#plus' finds by one and so 'structure' has fallen off the end, as it were.

If you increase the number in the line above that reads '#plus=11' to 12 that should work.

Basically, count how many keywords you have in each section of data and put it in the variable before each section.

Hope this helps. :)
Great, that do the trick.
Thanks a lot! :D

Posted: Thu Jan 18, 2007 1:41 pm
by ts-soft
I use this, works in all situations correct for me, also in linux:
http://www.purebasic.fr/german/viewtopi ... r&start=10