SyntaxBomb - Indie Coders

Languages & Coding => SmallBASIC => Topic started by: round157 on August 17, 2021, 23:58:01

Title: Atom editor
Post by: round157 on August 17, 2021, 23:58:01
They are talking about the editor:

https://www.syntaxbomb.com/appgamekit-agk/atom-editor/msg347051913/#msg347051913

The editor looks very nice.  How can sbasic.exe(console version) be used in the Atom editor? Thanks. (Is it possible? How to set?)

(No editor is for sbasic.exe in the current version of SmallBASIC.)
Title: Re: Atom editor
Post by: round157 on August 18, 2021, 00:09:03
Here:
https://atom.io/
Title: Re: Atom editor
Post by: Aurel on August 18, 2021, 19:19:51
In general i don't like to use one editor for few languages
that simply sucks but according to your experience we need to try.
Editor don't make language better? or maybe ..
Title: Re: Atom editor
Post by: round157 on August 18, 2021, 23:56:01
In general i don't like to use one editor for few languages
that simply sucks but according to your experience we need to try.
Editor don't make language better? or maybe ..

The Atom editor may not be good? Okay.
Title: Re: Atom editor
Post by: Aurel on August 19, 2021, 06:07:55
may not be good ...may be but that is just promotion of someone else work
editor for 100 lang-s i like a ..hoki on de loki

Chalenge:
Made code editor in Small basic for SmallBasic !!!!!!
Title: Re: Atom editor
Post by: bplus on August 20, 2021, 19:14:51
In general i don't like to use one editor for few languages
that simply sucks but according to your experience we need to try.
Editor don't make language better? or maybe ..

The Atom editor may not be good? Okay.

I remember Chris recommending to me the Atom editor years ago.
Title: Re: Atom editor
Post by: Aurel on August 21, 2021, 08:33:49
atom ,atom ...atomic

wait
is it even possible to make
code editor in Small basic for SmallBasic
...oups ...there is no .exe builder
Title: Re: Atom editor
Post by: jsalai on August 21, 2021, 11:33:41
atom ,atom ...atomic

wait
is it even possible to make
code editor in Small basic for SmallBasic
...oups ...there is no .exe builder

No need an .exe for that!
the initial menu, file list, file viewer, file manipulator is written in sb (I know it bcs I participate with a minor change)!
so could be an complete editor too! The "interpreter" (which actually compile) is fast enough!

just needed a kind soul to do that  :)
I'm too old (ignore that Jr Member attribute), and hate any colorations - a rellict from assem. cobol etc times....

and atom, geany, and of course, yours abandoned, are ready :)
Title: Re: Atom editor
Post by: round157 on August 21, 2021, 23:54:15
In general i don't like to use one editor for few languages
that simply sucks but according to your experience we need to try.
Editor don't make language better? or maybe ..

The Atom editor may not be good? Okay.

I remember Chris recommending to me the Atom editor years ago.

If chrisws writes a detailed guide for using sbasic.exe and the Atom editor, the guide will be very helpful to beginners in using SmallBASIC to learn programming!
Title: Re: Atom editor
Post by: Aurel on August 22, 2021, 00:04:43
you acting like you are bored of boring
Title: Re: Atom editor
Post by: bplus on August 22, 2021, 02:01:34
Actually Aurel had an editor working for sb way back when sb had a forum.
Title: Re: Atom editor
Post by: Aurel on August 22, 2021, 20:33:36
Yes i still have it but still open main SB window
for a difference version for qb64 work better opening compiler console ..
do the job ,and then when you click run (after compilation) your program run
standalone.
Unfotunatelly SB is not made on that way ..no mather is it interpreter
heck i even can run my own interpreter with few other editors as well.
Title: Re: Atom editor
Post by: bplus on August 23, 2021, 02:08:19
Yes i still have it but still open main SB window
for a difference version for qb64 work better opening compiler console ..
do the job ,and then when you click run (after compilation) your program run
standalone.
Unfotunatelly SB is not made on that way ..no mather is it interpreter
heck i even can run my own interpreter with few other editors as well.

Put sb in the Run Mode (right click menu popup click Editor [ON] to turn it off) now sb will run the program instead of loading it into the editor.
Title: Re: Atom editor
Post by: Aurel on August 23, 2021, 06:52:17
Yes i kinda remember that
but that option should be built into command line too
bad thing.... both interpreter and editor are pushed into one exe
ahh ..you know that i'm not real sb user
Title: Re: Atom editor
Post by: chrisws on August 23, 2021, 10:47:09
These are the current command line arguments:

usage: sbasicg [options]... [BAS] [OPTION]
  -h, --help
  -v, --verbose
  -k, --keywords
  -c, --command='<argument>'
  -f, --font='<argument>'
  -r, --run='<argument>'
  -x, --run-live='<argument>'
  -n, --run-n-wait='<argument>'
  -m, --module-path='<argument>'
  -e, --edit='<argument>'
  -d, --debug='<argument>'
  -p, --debugPort='<argument>'
Title: Re: Atom editor
Post by: jsalai on August 23, 2021, 16:00:01
works even so "nested"

0.bas
Code: [Select]
color 15,0
?"we are in prog 0.bas"
?"press Enter"
pause
'if needed, enter full path to sbasicg.exe
run "sbasicg -n 8q.bas"
?
?"now we are back from 8q.bas"
pause
end

works fine with -r, but with -n is no need to press the back key

8q.bas
Code: [Select]
'The Eight Queens puzzle is the problem of placing
'eight chess queens on an 8x8 chessboard so that no
'two queens threaten each other. Thus, a solution
'requires that no two queens share the same row,
'column, or diagonal. The eight queens puzzle is an
'example of the more general n queens problem of
'placing n non-attacking queens on an nxn chessboard,
'for which solutions exist for all natural numbers n
'with the exception of n=2 and n=3.
'The following is adapted Pascal program by Niklaus
'Wirth. It finds all (and all FUNDAMENTAL) solutions
'to the 4-9 queens problem (or more)
color 15,0
while 1
  z=0:f=0:input "N-queens - Board dim(4-9) (0-end):",n
  if n<4 or n>9 then cls:delay 300:end
  dim s(n),t(2*n),u(-n to n),d(n),w():cls
  Srch(1)
  ?z;" total postions - ";len(w);" fundamental"
wend

sub Srch(c)
  local r
  for r=1 to n
    if !s(r) and !t(r+c) and !u(r-c)
      d(c)=r:s(r)=1:t(r+c)=1:u(r-c)=1
      if c<n
        Srch(c+1)
      else
        show
      fi
      s(r)=0:t(r+c)=0:u(r-c)=0
    fi
  next
end

sub show
a=""
if z
  k=ubound(w)
  for j=0 to k
    e=w(j):l=j+1
    for i=1 to n:if e(d(i))<>n+1-i then exit for
    next:if i>n then a=a+" RL-"+l
    for i=1 to n:if e(n+1-d(i))<>i then exit for
    next:if i>n then a=a+" RR-"+l
    for i=1 to n:if d(i)<>n+1-e(n+1-i) then exit for
    next:if i>n then a=a+" R2-"+l
    for i=1 to n:if d(i)<>n+1-e(i) then exit for
    next:if i>n then a=a+" HH-"+l
    for i=1 to n:if d(n+1-i)<>e(i) then exit for
    next:if i>n then a=a+" VV-"+l
    for i=1 to n:if d(n+1-e(i))<>n+1-i then exit for
    next:if i>n then a=a+" DN-"+l
    for i=1 to n:if d(e(i))<>i then exit for
    next:if i>n then a=a+" D1-"+l
  next
fi
if a="":f++:a=" * * * "+str(f):w << d:fi
z++:?z,:for i=1 to n do ?chr(96+i);d(i),:?a
end
Title: Re: Atom editor
Post by: johnno56 on September 05, 2021, 21:32:00
Round157 asked, "How can sbasic.exe(console version) be used in the Atom editor?".

I have read through all the responses, I may have missed something, but the question, in my opinion, has not been answered. If 'yes' then how? I too would like to know. Because if it can, then perhaps, it will work with Geany (my editor of choice).

J
Title: Re: Atom editor
Post by: jsalai on September 07, 2021, 07:43:37
Round157 asked, "How can sbasic.exe(console version) be used in the Atom editor?".
I have read through all the responses, I may have missed something, but the question, in my opinion, has not been answered. If 'yes' then how? I too would like to know. Because if it can, then perhaps, it will work with Geany (my editor of choice).
J
see attached pic
In geany (for Windows) now Compile (F8) run in SDL, and Execute (F5) run in console...
Title: Re: Atom editor
Post by: Aurel on September 07, 2021, 09:41:59
I just found my AEdit for SB and check is still work   :o
yes work like a charm.. ;D

if anyone want to try/use let me know

Title: Re: Atom editor
Post by: bplus on September 07, 2021, 11:26:16
I just found my AEdit for SB and check is still work   :o
yes work like a charm.. ;D

if anyone want to try/use let me know

@Aurel  And how did you setup the code for the Run button?

I ask because it (might) sort of answer johnno56's question about setting up Geany.

But really now, Chris has got sb back into a normal editor.
(Now if he could only make it run as fast as the g version. ;-))
Title: Re: Atom editor
Post by: jsalai on September 07, 2021, 13:49:48
In Geany works syntax highlighting too as described in:
https://www.syntaxbomb.com/smallbasic/quick-question/msg347051511/#msg347051511

see pic below:
Title: Re: Atom editor
Post by: Aurel on September 07, 2021, 20:16:44
Jsali...i don't say that geany don't have syntax coloring then that is slow and
clumsey to use ..for me ..and require configuration file (tommaz always patronize about that one   :P)

Mark..
On windows i use standard api call ShellExecute() to run program
but before that editor must know in which folder (directory) is sbasicg.exe to send
command line ...so this one not work on linux, linux use different method but still depend on path of file.

my editor only require to be in same folder where is located sbasicg.exe and nothing else.
I can even change that but then i need to add compiler path feature in config file.

soo..do i need to upload it here ?
Title: Re: Atom editor
Post by: Aurel on September 07, 2021, 20:27:25
I just download and tested 12.23 with editor in sb32 folder
it is Mark program 3d sierpinski piramid and work fine
Title: Re: Atom editor
Post by: jsalai on September 07, 2021, 23:04:04
Jsali...i don't say that geany don't have syntax coloring then that is slow and
clumsey to use ..for me ..and require configuration file (tommaz always patronize about that one   :P)
.....
soo..do i need to upload it here ?

And I just wanted to complete the answer to Johno's question... as his favorite is geany... not to compete with anyone... In fact I don't use any syntax coloring as I'm colorblind, and nearsighted... and maybe a bit old... In illo tempore, I worked on teleprinter terminal... no syntax coloring, not even slashed O or 0...

And I was about to send an email to you that I'm interested... so, please, upload it here :)

No hard feelings  :)
Title: Re: Atom editor
Post by: Aurel on September 08, 2021, 20:57:39
Ok
In attachment is sb32 folder
when you unpack run AurelEditSB, run program clicking on >32
by the way editor you can use on 64bit windows too..

oups ...attachment is tooo limited .. :o
so iwill add link

https://aurelsoft.ucoz.com/sb32.zip
Title: Re: Atom editor
Post by: jsalai on September 08, 2021, 22:24:49
@Aurel: Thanks a lot.
Best!
 JS

PS. Works fine and fast....
Even my idiotic knight tour 90x50-1-1
and of course the marvelous B+'s "non recursive sierpinsky.bas"

Just not dark moon - I see nothing - just kidding (with a grain of truth) :)
Title: Re: Atom editor
Post by: Aurel on September 09, 2021, 19:32:50
thanks man i am glad that work

yes DarkMoon theme i made are with not so good colors choice..it
should be better,,,well i really very rare use dark themed editors ..i prefer
light themes...
but i will see..maybe i can improve it  ;D
SimplePortal 2.3.6 © 2008-2014, SimplePortal