hi guys, as I am using my tiny simplification of SSB now for QL(X)Commander code mods, I am also on background thinking about some extensions to SSB concept (it is somewhat possible to peek into it in what I shared to QLCommander thread); would be nice to have syntax coloring editor for such SSB code, without line numbers, similar as internal ED, but enforcing indentation, allowing copy/paste, so I have this also in mind, somewhere in background, ya ... but now I am using with QPC2 and the shared "drv1" the SciTE editor (defacto Notepad++ core "scintilla" C component), this is okay for now
BUT - BIGGER problem I have now is to identify some special SuperBasic "editing" commands, how to find them (I know ED, LIST, DLINE, RENUM, LOAD, SAVE, MERGE ... but can't now find some comprehensive doc which lists ALL of such "special/editing" commands not usable as much in code (without TYPE_IN or so), as I am looking for some "SEARCH", some "LIST/FIND procedurename" to find line where something is defined or so - in win/desktop SciTE I can do simply "find", but in QL SB window (ED + cmdline), where I have now generated (unimportant) line numbers, I dont know where quickly get on which line number is function/procedure defined to bring "ED line" to move there ... I think I saw it somewhere, as such "search" commands may exist, may be in some toolkits(?)
- kindly please, is something like this possible??
Petr
here for reference is my current simplified "CompileSsb2Bas" (no @labels, no #include, double apostrof '' for comments)
(I wish to use mostly functions instead of procedures, always returning something/err (not ignorable as in C, ya?), always in "fncall()" form, want to allow "SSB multiline" based on such fncall(...) lines sequence, maybe add later "var++, var--" post in/de-crements and few most used tiny things to even simplify coding - its all experimental towards my own other project too; there may occur also something like "SSC" form soon, where SB constructs may be modified for usage of "curly braces" to "mimic simple C" as much as possible, while staying still SSB/SB transpilable easily (usable in VSCode or refactorings/renamings of funcs/vars) - one thing I want also to change is having "integers as default", without the "%" suffix (as I need mostly integers and strings only, and the "%" suffix everywhere complicates reading of code), with "%" suffix generated only in final SB code - for such form of SSB/SSC can then be useful native QL syntax coloring editor similar to "ED" (but this later, similar situation as you have with time... AND probably/sure, there are REAL SB PROs who can do this... I am still trying to grasp it all for as easy as possible programming)
Code: Select all
''-----------------------------------------------------------
''QLXC IDE simplified SSB to BAS conversion
''- missing support for @Lables and #include, now !!!
defproc CompileSsb2Bas(ssb_filename$, bas_filename$)
local i, x$
ierr = fop_in(#10, ssb_filename$)
oerr = fop_over(#11, bas_filename$)
print #11, "1 rem &&SSBGEN"
linenum = 10
repeat linenum
input #10, in$
if EOF(#10) then exit
if (chr$(38) & chr$(38) & "QLCGEN") instr in$ then exit
out$ = in$
if in$ = "" then out$ = ":"
pos = (chr$(39) & chr$(39) instr in$)
''or ("##" instr in$) or ("//" instr in$) + odd '
if pos > 0
if pos > 1
for i = 1 to pos : if in$(i) <> " " then exit : next i
if i < pos
comment$ = ": rem"
else
comment$ = "rem "
endif
out$ = in$(1 to pos - 1) & comment$
else out$ = "rem "
endif
out$ = out$ & in$(pos to)
endif
print #11, linenum & " " & out$
linenum = linenum + 2
endrepeat
close #10
close #11
enddef