Page 1 of 2

Posted: Thu Apr 17, 2003 10:25 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.

No, i'm not crazy. I only workd 3 Days (and one night) on this:

http://caosandkin.bei.t-online.de/pureb ... -gpi-4.zip

Whats new:

I complete remove the "ProcedureParser.pb" and include the "FindAllNames.pb".

FOLDING
You read right, the Editor can now folding.
Press Ctrl+D and a existing fold is unfold or the procedure or current selection would be folded.
A folded line is write-protected. Also a copy is forbitten, if parts of a fold is selected.
The linenumber in the Statusbar are corrected.
You can also fold procedures by double-click on the word "Procedure" or in the Procedure-Browser. Folds can be unfolded by doubleclick on the fold.
In menu are the functions "Folding all" (all procedures will be folded) and "UnFolding all" (all folds will be unfolded). This functions are slow. So please wait.
At the moment you can fold a fold.
The folds are marked with ';f«:' and ';f»:' at the lineend, so older editors can open the code without any problems. Also search find folded text.

AutoFormat - (default:on)
If you don't want, that the Editor correct "endif" to "EndIf", disable this function in the preferences.

Extended Format - (default:off)
Open a new Source-Code and activate this function in the Preferences.
Now type this two lines:
#Constant = 20
#CONSTANT = #CoNsTaNt + 10
the second line should be formated to
#Constant = #Constant + 10
The Editor search the first word and take from this the formating style. Also in the right Panel all founded words are listet in 4 diffrent slots.
Var(iables): everything that don't pass in the other slot, normal Variables and Labels
Const(ant): all Constants
Struc(ture): all Structures
Proc(edure): all Procedures, LinkedList and Arrays (DIM)
If you want to change the default Formating-Style, you have to possiblities:
a) DoubleClick in the list on the right Side an change the Style. After pressing Return, the complete Sourecode will be reformated and this will be take time!
b) Found the first word. Change the Style (Attention: After pressing the Cursorkey, Del or Backspace the autoformation will be startet, so delete first, then type) and press then F2. If this word is realy the first entry, then the style is changed (look in the list) and the editor doesn't start to reformate the complete text.
Folded text are not listed in the Slots. But Labels are listed in the Bookmarks.

Two Notes:
a) The Compiler differt between this variables
*Hell
HELL
hell$
Extended Format doesn't. This would be formated to
*Hell
Hell
Hell$

b)The Editor will be slow down on long sources. The writting of new text should be normal, but press fast cursor-up (don't hold). Open the "PureBasic IDE.pb" and test this. At my System i get this times (activated Debugger!)
without extended format: .080 s
with extended format: .380 s
with extended format and all procedures are folt: .190 s.
What do we learn: folt everything or seperate the code in diffrent files.

Extended-Error-Message
If a error is in a Include-File, the editor switch to this file and mark the line.
I don't think, that it was helpfull, that the Include-line of the main-programm is marked...

Find-Window
The position of the Find-Window is now saved. Also, if the Find-Window is open and the Main-Window is active, press ESC to close the Find-Window.
Ctrl+F doesn't take the current word for search. This do now Ctrl+R.

Insert Space
Is removed, because there is a undocumented Function in the Editor (press tab or shift+tab)

Wrong name in the Panel
I hope, this is now corrected. If not, please write me, what excat you have done.

Set as main
Is a extention to the CompileThis - option.
This that to all open SourceCodes, that the active line should be compiled.
Attention: New (opened) SourceCodes don't know this.


PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Apr 18, 2003 5:54 am
by BackupUser
Restored from previous forum. Originally posted by cor.

Cannot compile source with 3.62.

I think it's not the correct version.

Uses procedureparser and rset fault in pickcolor.pb



Using Windows 98 SE
Registered Purebasic
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
http://www.chordplanet.com

Posted: Fri Apr 18, 2003 7:58 am
by BackupUser
Restored from previous forum. Originally posted by GPI.

I forget to remove the XIncludeFile "ProcedureParser.ob" (the line, which the compiler said, that he doesn't found the file)

Please delete this line.


PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Apr 18, 2003 8:11 am
by BackupUser
Restored from previous forum. Originally posted by fred.

Really nice work ! The fold is working perfectly here and other functions are cool too. Your new find dialog is now in the official one and we are looking to implements some other features.

Fred - AlphaSND

Posted: Fri Apr 18, 2003 9:07 am
by BackupUser
Restored from previous forum. Originally posted by cor.

Error when compiling at pickcolor.pb

->Incorrect number of parameters

Line 59
ProcedureReturn RSet(Str(Value),3,"0")

compiled with latest string lib (17-04)

Using Windows 98 SE
Registered Purebasic
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
http://www.chordplanet.com

Posted: Fri Apr 18, 2003 9:26 am
by BackupUser
Restored from previous forum. Originally posted by GPI.

Strange, i never changed the pickcolor.pb and the help said, that there is no error.

I haven't this new lib and it seems, that the new lib has a error. Take the old one and it work.

btw.: Correct the icon-path in the compiler-options or you get a error, that an icon isn't found (ignore this).

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Apr 18, 2003 9:34 am
by BackupUser
Restored from previous forum. Originally posted by cor.

Old string lib same problem

Using Windows 98 SE
Registered Purebasic
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
http://www.chordplanet.com

Posted: Fri Apr 18, 2003 10:38 am
by BackupUser
Restored from previous forum. Originally posted by GPI.

Reinstall your PB.

You are the only one, how report this bug (This doesn't mean, that i think, you are lie; I think, that something with you system is wrong)

EDIT:
change the line
ProcedureReturn RSet(Str(Value),3,"0")
to
ProcedureReturn Str(Value)

What happend then?

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Apr 18, 2003 11:00 am
by BackupUser
Restored from previous forum. Originally posted by Berikco.

GPI :)

Great job....it compiles/works perfect here :)
This Folding is just fantastic...well done!

Regards,

Berikco

http://users.pandora.be/berikco/purebasic.htm

Posted: Fri Apr 18, 2003 11:02 am
by BackupUser
Restored from previous forum. Originally posted by cor.

Problem solved.

There was a user lib StringLibraryEx which causes the problem.
Is there a way that the debugger can solve this?
Now it's difficult to search where problem is.

Compiled with the latest lib updates from Fred works ok now

@GPI
Great work, folding is working fine (win98 se) :)
Have to look at other features now.

Thanks for your time



Using Windows 98 SE
Registered Purebasic
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
http://www.chordplanet.com

Posted: Fri Apr 18, 2003 12:53 pm
by BackupUser
Restored from previous forum. Originally posted by Justin.

Very good improvements, great job.

a suggestion:
i would use 2 separate dialogs one for find and another one for find and replace so you don't need to take care of check or uncheck 'replace with' each time you make a search.

also i miss a wrap around search option, it seems only searches from the caret position to the end.

Posted: Fri Apr 18, 2003 12:54 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.

Ok, i found the first bug.

If you have a fold at the last line, you can open and close it, but when you save and load it again, you get problems. You can't open the fold.
The Sourcecode isn't changed and is ok.

My solution for this Problem is simple. If you load a source, the editor checks if a empty line is at the end. If not he will insert one. So it should work.

open the "PureBasic IDE.PB" and replace the original "AnalyseProjectSettings" with this code:

Code: Select all

Procedure AnalyseProjectSettings(*Buffer, Length)
  
  *Cursor.Byte = *Buffer+Length
  
  While (Length)

    ;-gpi-change fold-error
    While (Length) And *Cursor\b  10 And *Cursor\b13
       Length-1
      *Cursor-1
    Wend
    ;gpi-endchange
    
    If Length
      Line$ = PeekS(*Cursor+1)
      If Line$ = "; EOF"
      ElseIf Line$ =          "; EnableNT4"         : FileList()\EnableNT4 = 1
      ElseIf Line$ =          "; EnableAsm"         : FileList()\EnableASM = 1
      ElseIf Line$ =          "; EnableXP"          : FileList()\EnableXP  = 1
      ElseIf Line$ =          "; DisableDebugger"   : FileList()\Debugger  = 0 :
      ElseIf left(Line$,13) = "; Executable="       : FileList()\ExecutableName$   = right(Line$, Len(Line$)-13)
      ElseIf left(Line$,19) = "; ExecutableFormat=" : FileList()\ExecutableFormat$ = right(Line$, Len(Line$)-19)
      ElseIf left(Line$,14) = "; CommandLine="      : FileList()\CommandLine$      = right(Line$, Len(Line$)-14)
      ElseIf left(Line$,10) = "; UseIcon="          : FileList()\UseIcon = 1 : FileList()\IconName$ = right(Line$, Len(Line$)-10)
      ElseIf left(Line$,6)  = "; CPU="              : FileList()\CPU = Val(right(Line$, Len(Line$)-6))

      ;--------------------- GPI-Change savecursorpos compileThis                
      ;                         12345678901234567890123
      ElseIf left(line$,17) = "; CursorPosition="
        CursorPositionY=Val(right(line$,Len(line$)-17))
      ElseIf left(line$,14) = "; CompileThis="
        FileList()\CompileThis$=right(line$,Len(line$)-14)
      ;gpi-endchange

      Else : Length = 0
      EndIf
     
      If Length
        ;-gpi-change fold-error
        If PeekB(*Cursor-1)=10 Or PeekB(*Cursor-1)=13
          *Cursor-1
        EndIf
        *Cursor\b = 0
        *Cursor-1
        *savecursor=*Cursor
        ;gpi-endchange
      EndIf
    EndIf
  Wend
  ;-gpi-change folderror
  If *savecursor>0
    While (PeekB(*savecursor-1)=10 Or PeekB(*savecursor-1)=13) And *savecursor-1>*Buffer
      *savecursor-1
    Wend
    If *savecursor>*Buffer
      If PeekL(*savecursor)$0a0d0a0d
        PokeL(*savecursor,$0a0d0a0d)
        PokeB(*savecursor+4,0)
      EndIf
    EndIf
  EndIf
  ;gpi-endchange
  
  CompilerIf #Demo = 0
    SetMenuItemState(0, #MENU_Debugger, FileList()\Debugger)  
  CompilerEndIf
EndProcedure
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Apr 18, 2003 1:39 pm
by BackupUser
Restored from previous forum. Originally posted by Berikco.

Got a problem with the labels on the TAb's, they dont match the source from the 4the label.
All names are shifted right after 4the label, last one is gone.
I switched on the Extended Format function, and doubleklicked on procedure in the listview.




Regards,

Berikco

http://users.pandora.be/berikco/purebasic.htm

Posted: Fri Apr 18, 2003 2:49 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.

Stupid error in one of my Procedures

Code: Select all

Procedure MarkChanged()
  If DontMarkChanged=0
    panel=GetGadgetState(#GADGET_FilesPanel)
    Count=CountList(FileList())
    If panel0 And panel>-1 And CountGadgetItems(#GADGET_FilesPanel)=Count;prevent crash, if a new panel exist, but no new filelist()-element
     
      *gpi_save_filelist=@FileList()
      
      SelectElement(FileList(), panel)
      If @FileList()=*gpi_save_filelist
        gpi_richedit=FileList()\RichEdit
        If FileList()\FileName$
          Title$ = GetFilePart(FileList()\FileName$)
        Else
          Title$ = ""
        EndIf
        If SendMessage_(gpi_richedit, #EM_GETMODIFY, 0, 0) 
          If FileList()\changed=0
            SetGadgetText(#GADGET_FilesPanel,"*"+title$)
            FileList()\changed=1
          EndIf
        Else
          If FileList()\changed
            gpi_get$=GetGadgetText(#GADGET_FilesPanel)
            SetGadgetText(#GADGET_FilesPanel,title$)
            FileList()\changed=0
          EndIf
        EndIf
      EndIf
      ChangeCurrentElement(FileList(),*GPI_save_filelist)
    EndIf
  EndIf
EndProcedure
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Apr 18, 2003 2:56 pm
by BackupUser
Restored from previous forum. Originally posted by Henrik.

Hi GPI Works great on win98 se
@Berikco this prob. was allready atleast in ver.3.62 if not early
should have said somthing about it, but kind of forgot.

GPI are you talking about prob. Berikco stated, cuz the procedure your just posted didn't solve the problem
Label-tab's Vs. source-names
weird i can't reproduce the error now :)
everything works fine now.
Supper great work GPI, forget what i said i don't know what i'am talking about :)

anyway great work gpi.
bedst regards
henrik