Page 80 of 104

Posted: Mon May 11, 2009 1:23 pm
by gnozal
LCD wrote:But it does not look like there is something wrong with the file. JaPBE says there is a end folding mark without start folding at line 137, but does not say in which of the sources. I checked all of them, but I found only ENDPROCEDURE keyword at this position.
jaPBe displays this message when you use the 'Fold all' function and there is a mismatch between OpenFold and CloseFold markers in the current source.
Example : with this code you get 'Line 4 : fold marker open without close' when you use 'Fold All'.
It means that no 'Close' marker is matched with the 'Open' marker in line 4.

Code: Select all

Procedure Anyproc()
  
  ;{
  ;{
  
EndProcedure

Procedure Anyproc2()
  ;}
EndProcedure
This is sometimes hard to spot when there are many embedded folding markers.
LCD wrote:, but returning to previously installed Build 785 cured the problem...
That's interresting. I have uploaded a new build (790). Could you test it ?

Posted: Mon May 11, 2009 5:35 pm
by LCD
gnozal wrote:
LCD wrote:But it does not look like there is something wrong with the file. JaPBE says there is a end folding mark without start folding at line 137, but does not say in which of the sources. I checked all of them, but I found only ENDPROCEDURE keyword at this position.
jaPBe displays this message when you use the 'Fold all' function and there is a mismatch between OpenFold and CloseFold markers in the current source.
Example : with this code you get 'Line 4 : fold marker open without close' when you use 'Fold All'.
It means that no 'Close' marker is matched with the 'Open' marker in line 4.

Code: Select all

Procedure Anyproc()
  
  ;{
  ;{
  
EndProcedure

Procedure Anyproc2()
  ;}
EndProcedure
This is sometimes hard to spot when there are many embedded folding markers.
LCD wrote:, but returning to previously installed Build 785 cured the problem...
That's interresting. I have uploaded a new build (790). Could you test it ?
Tested: Build 790 suffers from exactly the same problem... So I was forced to switch back again to 785 (I don't have 786 and 787 so I cannot test them).
Btw. the autofolding stops on lines like this one:

Code: Select all

  If evm=menu_copy ;{
    CreateImage(#Image_Clipboard,garray(#Global_RedrawSizeX)<<3,garray(#Global_RedrawSizeY)<<3-garray(#Global_YPixReduction))
    Quickredraw(0,#Image_Clipboard,*screenbuffer,scrmode,garray(#Global_PicresX),garray(#Global_PicresY),garray(#Global_Attr_offset))
    SetClipboardImage(#Image_Clipboard)
    MessageRequester(transl(#txt_info),transl(#txt_Picture_copied_clipboard),#MB_ICONINFORMATION)
    ClearEvents1()
    Goto Hauptschleife_painter
  EndIf ;}
It does only underscore the first line, but not folding the other. This happens only at autofolding, and if I "unfold" the line again and fold it, it works again sometimes.
I know where it supposes to claim bad folder marks, but these lines are clean, and every time I reload JaPBE with the sources (which are agein unfolded) it claims a different line to have bad folder marks...
I even made a new folder for JaPBE, but the same problem.

Just tested again:

Code: Select all

Procedure FontAutoload(Filename$)
  If Filename$<>""
    Size=FileSize(Filename$)
    file=ReadFile(#PB_Any,Filename$)
    If LCase(GetExtensionPart(Filename$))="tap"
      If Size=793
        ReadTAPFile(file,0,*FontMemory+256)
      EndIf
    EndIf
    If file And Size=2048
      ReadData(file,*FontMemory,2048)
      CloseFile(file)
    ElseIf file And Size=768
      ReadData(file,*FontMemory+256,768)
      CloseFile(file)
    ElseIf file And Size=168
      ReadData(file,*FontMemory+1152,168)
      CloseFile(file)
    ElseIf file And Size=152
      ReadData(file,*FontMemory+1152,152)
      CloseFile(file)
    Else
      ReadData(file,*FontMemory,2048)
      minrange=ReadByte(file):maxrange=ReadByte(file)
      For a=0 To 255
        fontdata(a)=ReadByte(file)&255
      Next a
      CloseFile(file)
    EndIf
  EndIf
EndProcedure
EndProcedure=Bad folder mark...

I will test it on my Notebook too...

Edit: Tested on my notebook: Exactly the same problem: 785 works, 790 ignores all folding informations successfull. So it is not a problem of my PC.

Posted: Tue May 12, 2009 7:42 am
by gnozal
LCD wrote:Btw. the autofolding stops on lines like this one:

Code: Select all

  If evm=menu_copy ;{
...
  EndIf ;}
I have tested all your posted code, no problem here.

I see you are using manual folding with If/EndIf ; sorry if I ask the question again (see nicolaus's post), but you don't have custom folding activated for If/EndIf ?

I will search for something else ... could you try this executable : http://freenet-homepage.de/gnozal/jaPBe_Test.zip ?

Posted: Tue May 12, 2009 3:04 pm
by LCD
gnozal wrote:
LCD wrote:Btw. the autofolding stops on lines like this one:

Code: Select all

  If evm=menu_copy ;{
...
  EndIf ;}
I have tested all your posted code, no problem here.

I see you are using manual folding with If/EndIf ; sorry if I ask the question again (see nicolaus's post), but you don't have custom folding activated for If/EndIf ?

I will search for something else ... could you try this executable : http://freenet-homepage.de/gnozal/jaPBe_Test.zip ?
Strange...
No, I never defined any custom folding keywords for anything, that's why I use ;{ and ;} in the code.
I tested the JaPBE Test file and now it folds correctly my source after loading... But it does not save the folding information in source if I use autofolding and close the program (it does not even ask to resave), but after manual save it works.
The false positive (Fold end without open for EndProcedure) is still there
for example, here:

Code: Select all

Procedure GrabToFont()
  window=OpenWindow(#PB_Any,20,20,300,200,"Grab to font",#PB_Window_TitleBar)
  ;If Not CreateGadgetList(WindowID(window)) Or Not window:MessageRequester(transl(#txt_error),transl(#txt_cantopenwindow),#MB_ICONERROR):Goto beenden:EndIf
  StickyWindow(window,1)
  ignore_protected=CheckBoxGadget(#PB_Any,5,5,290,19,"Ignore protected")
  TextGadget(#PB_Any,5,25,170,19,"First char:")
  firstchar=SpinGadget(#PB_Any,180,25,40,19,0,255,#PB_Spin_Numeric)
  okButton=ButtonGadget(#PB_Any,260,155,30,19,"O.K.")
  CancelButton=ButtonGadget(#PB_Any,200,155,55,19,"Cancel")
  SetGadgetState(firstchar,32):SetGadgetText(firstchar,"32")
  close=0
  Repeat
    wwe=WaitWindowEvent()
    If wwe=#PB_Event_Gadget:evg=EventGadget():evt=EventType()
      If evg=okButton:close=1:EndIf
      If evg=CancelButton:close=2:EndIf
      If evg=firstchar:SetGadgetText(firstchar,Str(GetGadgetState(firstchar))):EndIf
    EndIf
  Until close
  noprotected=GetGadgetState(ignore_protected)
  xs=garray(#Global_Sel_X_S)
  ys=garray(#Global_Sel_Y_S)
  wID=garray(#Global_Sel_X_W)
  hgt=garray(#Global_Sel_Y_W)
  If SelXStart>SelXEnd:Swap SelXStart,SelXEnd:EndIf
  If SelYStart>SelYEnd:Swap SelYStart,SelYEnd:EndIf
  Char=Val(GetGadgetText(firstchar))
  If close=1
    If scrmode=0 Or scrmode=1 Or scrmode=2 Or scrmode=12 Or scrmode=13 Or scrmode=32 Or scrmode=34 Or scrmode=35
      For y=ys To ys+hgt
        For x=xs To xs+wID
          GrabChar(x,y,Char)
          If Char<255
            Char+1
            While bits(fontdata(Char),1) And noprotected And Char<255
              Char+1
            Wend
          Else
            Break 2
          EndIf
        Next x
      Next y
    Else
      MessageRequester(transl(#txt_error),"Incompatible screen mode")
    EndIf
  EndIf
  CloseWindow(window)
EndProcedure
But I noticed that the syntax highlightning was not highlightning the first quoted line until I set cursor there.
maybe the lexer was not able to "see" this line as Autofolding start?

Posted: Tue May 12, 2009 3:20 pm
by gnozal
LCD wrote:I tested the JaPBE Test file and now it folds correctly my source after loading... But it does not save the folding information in source if I use autofolding and close the program (it does not even ask to resave), but after manual save it works.
What is autofolding ?
LCD wrote:The false positive (Fold end without open for EndProcedure) is still there
for example, here:...
Does it display 'a false positive' with this example ? No problem here.
Still, I think there might be a mismatch between OpenFold and CloseFold markers in your (complete) source. Could you try to remove all manual folds ;{ and ;} from your source (use a copy) using find/replace and see what happens ?
Btw, I updated jaPBe to build 792.

Posted: Tue May 12, 2009 4:38 pm
by LCD
gnozal wrote:
LCD wrote:I tested the JaPBE Test file and now it folds correctly my source after loading... But it does not save the folding information in source if I use autofolding and close the program (it does not even ask to resave), but after manual save it works.
What is autofolding ?
LCD wrote:The false positive (Fold end without open for EndProcedure) is still there
for example, here:...
Does it display 'a false positive' with this example ? No problem here.
Still, I think there might be a mismatch between OpenFold and CloseFold markers in your (complete) source. Could you try to remove all manual folds ;{ and ;} from your source (use a copy) using find/replace and see what happens ?
Btw, I updated jaPBe to build 792.
Autofolding="Alle falten (german version) Alt+D"

My custom wordlist is completly empty, not a single entry...

I removed all ;{ and ;} and now autofolding did not reported any problems.
I will download the new version of JaPBE.

Posted: Tue May 12, 2009 4:43 pm
by gnozal
LCD wrote:Autofolding="Alle falten (german version) Alt+D"
Ok, thanks.
LCD wrote:I removed all ;{ and ;} and now autofolding did not reported any problems.
I think there was a mismatch with the manual coding markers.

Posted: Tue May 12, 2009 6:35 pm
by LCD
gnozal wrote:
LCD wrote:I removed all ;{ and ;} and now autofolding did not reported any problems.
I think there was a mismatch with the manual coding markers.
But folding them manualy was working correctly. Anyway, thank you for the new version. I try to write myself a editor for the ZXBasic Compiler (The lexer is very hard to write) and now I know how hard it is to write something excellent like JaPBE :-).

Posted: Wed May 13, 2009 7:54 am
by gnozal
LCD wrote:But folding them manualy was working correctly. Anyway, thank you for the new version.
Manual folding and 'Fold all' rely on different code.
LCD wrote:I try to write myself a editor for the ZXBasic Compiler (The lexer is very hard to write) and now I know how hard it is to write something excellent like JaPBE :-).
Good luck and thanks :D

Posted: Wed May 13, 2009 9:42 am
by gnozal
Update

Changes :
- implemented LSI's fix to improve jaPBe's portability
LSI (french forum member) wrote: ; Allow to correct path from preference to make jaPBe portable
; If jaPBe don't change path, path from preferences don't change
; If jaPBe is moved, path from preferences is adjusted to follow

Posted: Fri May 29, 2009 6:47 pm
by RichardL
Hi Gnozal,
Good afternoon from a sunny south east England, I have code to write and grass to cut and sometime, a beer to drink... decisions, decisions :D

Anyway, the serious bit:

Is there any way I can define the executable file name in the source file. This would help me get the right executable built from a source file that uses a lot of 'CompilerCase' directives to build one of three versions of a program from a single source file.

Something like: %Executable = "Lite" to produce Lite.exe

Best regards,
RichardL

Posted: Fri May 29, 2009 6:52 pm
by Denis
Salut Gnozal,

I get this error with PB 4.31 beta 2 and JAPBE
May be a PB problem, not a JAPBE. Sometime i get this kind of error with PB ide.


Image

Posted: Sat May 30, 2009 7:34 am
by gnozal
Denis wrote:I get this error with PB 4.31 beta 2 and JAPBE
May be a PB problem, not a JAPBE. Sometime i get this kind of error with PB ide.
It's not PB's fault.
It's an error (error line is in GPI's original code) I get sometimes myself when I close a tab, with all PB versions I worked with.
Unfortunately, I didn't spot the problem yet (memory corruption ?).

jaPBe doesn't format Procedure declaration Array parameters

Posted: Sun May 31, 2009 4:23 am
by Demivec
In a declaration of a procedure such as this:

Code: Select all

Procedure test(Array a(1), Array b(1)) ;formatted "Array" text
Procedure test(Array a(1),Array b(1)) ;unformatted "Array" text
only the first declaration has both "Array" words formatted (in bold, according to my settings), while the second one leaves the second one unformatted because there is no space before the word "Array".

This also occurs when "List" is used instead of "Array".

Posted: Tue Jun 02, 2009 9:42 am
by gnozal
Should be fixed in build 794.