jaPBe 3.13.4 [IDE for PB 4 and PB 5]

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Post by RichardL »

Good morning Gnozal,

In the lab we have been discussing backup policy and a colleague pointed out that a user might compile several times to review a trivial cosmetic change and cause a major change to drop of the end of the chain.

We could not see a perfect answer to this problem. Some primitive ideas..., 'keep the last file from yesterday' or 'do not count today's files when removing files'.

My network manager said 'Why not provide a courteous message warning to the user that 'Your backup directory is exceeding ten times the most recent source file size, please review contents of <Path>'

As I said... no perfect solution :(

Best regards,
RichardL
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

RichardL wrote:We could not see a perfect answer to this problem. Some primitive ideas..., 'keep the last file from yesterday' or 'do not count today's files when removing files'.
Sure, there is no such thing as a perfect solution.
In my opinion, if you have a daily server backup (assuming your sources are on the server), this should not be a problem.
Anyway, I fixed the ‘Maximum Count of Backups’ bug for the next build.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
klaver
Enthusiast
Enthusiast
Posts: 147
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Post by klaver »

Are there plans of support for the " : " operator (merge lines)?

When I make such line of code: "If a = 1 : b = 2 : EndIf"
And press enter to make new line, jaPBe adds "EndIf" because it thinks the IF statement is not closed :/

Second: if there's a commented-out piece of code, and I copy-paste it somewhere all indent gets destroyed - what's the purpose of this?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

There's no perfect backup mechanism, I struggled with this with CodeCaddy as well. In the end I decided on a compromise: I create a numbered backup every 'n' compile / runs. I was fooling around with a 'smart' feature that would look at the actual changes but found it slowing down the whole process.

Perhaps I'll add a feature to CodeCaddy to write backups more often if more than 'n' bytes have changed (just checking file sizes) but that begs the question: what's the right number of bytes?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

@blueznl
but a different size in bytes doesn't say anything about the extent of changes in the file. in the worst case you have a completely different file of same size.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

klaver wrote:Are there plans of support for the " : " operator (merge lines)?
Not really. But now that you mention it, I will add an additional check for the next release.
klaver wrote:When I make such line of code: "If a = 1 : b = 2 : EndIf"
And press enter to make new line, jaPBe adds "EndIf" because it thinks the IF statement is not closed :/
Meanwhile, you can disable this feature in Preferences (Editor 2 -> 'Autocomplete for If/Select/For...' checkbox) if it annoys you.
Personally, I don't like code blocks on the same line (it's much clearer with indentation).
klaver wrote:Second: if there's a commented-out piece of code, and I copy-paste it somewhere all indent gets destroyed - what's the purpose of this?
I can't reproduce this (or I don't understand).
If I copy/paste this code

Code: Select all

; Repeat
  ; UndentedStuff()
; Until
I get this

Code: Select all

; Repeat
  ; UndentedStuff()
; Until


; Repeat
  ; UndentedStuff()
; Until
No indent is destroyed.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
klaver
Enthusiast
Enthusiast
Posts: 147
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Post by klaver »

gnozal wrote:No indent is destroyed.

Code: Select all

; Repeat
  ; UndentedStuff()
; Until

Repeat
  Event = WaitWindowEvent()
  If Event = #PB_Event_CloseWindow
    ;PASTE HERE
  EndIf
ForEver
How about this?

I also don't like the ":" operator very much, but sometimes it's used (and it's ok if the line is not too long). And as it's part of the PB language, jaPBe should support it - otherwise it's not a really PB editor.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

klaver wrote:How about this?
Ok, I get it now.
By design, text in comments is not indented.
For example, how should jaPBe know if the line '; If etc...' is a standard comment ['If' is not a keyword] or a commented-out code block ['If' is (was) a keyword] ?
klaver wrote:I also don't like the ":" operator very much, but sometimes it's used (and it's ok if the line is not too long). And as it's part of the PB language, jaPBe should support it - otherwise it's not a really PB edito.r
I have added an additional check for the next release.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
denise_amiga
New User
New User
Posts: 7
Joined: Fri Sep 09, 2005 5:27 pm

bug in autocomple

Post by denise_amiga »

hi gnozal

autocomplete with structures is "buggy"

Code: Select all

Structure aa
    a.s  ;<- Indentation with real tab
    b.l
EndStructure

bb.aa

bb\         <--- window show chr(9)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: bug in autocomple

Post by gnozal »

denise_amiga wrote:autocomplete with structures is "buggy"
Thanks for the report.
It's already fixed in my 'work in progress' version.
I expect the next build to be released sometime in August.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Scintilla Highlighting

Post by Xombie »

Good morning!

Does anyone have a simple example of setting up highlighting within Scintilla? I've got the following so far and it works but I'm not sure how to turn on bracket highlighting or to bold the keywords.

Code: Select all

      ScintillaSendMessage(#StringSQL, #SCI_SETLEXER, #SCLEX_SQL, 0)
      ScintillaSendMessage(#StringSQL, #SCI_SETKEYWORDS, 0, @"select from where insert into update inner join outer left begin end")
      ScintillaSendMessage(#StringSQL, #SCI_STYLESETFORE, #SCE_C_WORD, $FF0000)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Hi Xombie,

jaPBe doesn't use a predefined lexer nor SCI_SETKEYWORDS so I have no experience with these.
To support coloring of keywords, identifiers etc, it uses SCLEX_CONTAINER with SCN_STYLENEEDED notifications.

Here are some examples that may help :
http://www.purebasic.fr/german/viewtopic.php?t=13234
http://www.purebasic.fr/english/viewtopic.php?t=19418
http://www.purebasic.fr/english/viewtopic.php?t=31731
One big example is the jaPBe source, mostly Editor-Core.pbi and WindowCallback.pbi (for the scintilla notifications).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Thanks, gnozal! I'll dig around at those examples and post something if I can get a solution that I like.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update ( V3.9.8 )

Changes :
- added PB4.40 keywords : Map, NewMap, Threaded.
- smart structure autocompletion now should also work within a With/EndWith block.
- added a spinbox in preferences [Editor 2 tab] to set the minimum characters needed before showing the autocompletion
  drop down list (default setting is 1).
- new dialog for macro errors [now that PB4.40 reports the correct error line].
- compiler messages are now localized (PBCompiler started with /LANGUAGE) [PB4.30+].
  If you want to keep english error messages, add 'LocalizeCompilerLanguage = 0' in '[Editor]' section in jaPBe.pref.
- structure viewer : 'Insert Variable' now generates a With/EndWith block.
- added command block highlighting.
  Example : if you leave the mouse pointer for a while over 'WHILE', jaPBe highlights it as well as the matching 'WEND'.
  Needs to be enabled in preferences [Preferences -> General 2 -> Highlight blocks].
- added 'Goto matching keyword' in 'Find' menu [shortcut = CTRL+K].
  Example : if the carret is over 'WHILE', jaPBe jumps to the matching 'WEND'.
- labels are now highlighted in ASM style.
- removed CPU monitor (wasn't working well with newer CPU's anyway).
- jaPBe no longer uses my custom Tailbite but the 'official' one.
- some miscellaneous fixes.
- manual updated.
- added on-line manual.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Post by LCD »

Sorry, but the folding after loading of files is screwed up again:
Example: "Line 314 in 'scanner_wrapper.pb': folding keyword /stored line mismatch ; folding canceled"
And this in all files!
It points to Procedure, ProcedureDll and ;{.
No custom folding keywords are used. Custom folding list is empty.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Post Reply