(06-22-2023, 03:25 PM)TerryRitchie Wrote:(06-22-2023, 03:18 PM)bplus Wrote:But there is no syntax highlighting? I like the syntax highlighting.(06-22-2023, 02:37 PM)RhoSigma Wrote: Hi Terry, indeed this seems to happen with the [ q b ] code tag and as I noticed somtimes it even get worse after editing/updating a post containing such codeboxes, but couldn't find out a cause for that to give @grymmjack a hint where to look for a fix.
However, you know and used already the IDE code export facility in your tutorial. Since v3.8.0 you can also export into a [ q b = e x p o r t ] forum codebox which preserves all spacing and links keywords to the Wiki pages as usual. The only "disadvantage" is that this type of codebox does not have line numbers.
Ah good an example of qb = export to test!
Code: (Select All)
_Title "test my 3 for 1 function" ' b+ 2023-06-22
For i = 1 To 12
Print FillNumberStr$(i, "0", 1234), FillNumberStr$(i, " ", 1234), FillNumberStr$(i, "_", 1234)
Next
Print "Result make sure places is greater or equal to longest number to display"
Print "In the 1234 example that would be 4 digits for places"
Function TS$ (nn) ' this comment started on column 60
TS$ = Right$("0000" + LTrim$(Str$(nn)), 4)
End Function
Function TS1$ (nn1) ' this comment started on column 60
TS1$ = Right$("00" + LTrim$(Str$(nn1)), 2)
End Function
Function TS2$ (nn2) ' this comment started on column 60
TS2$ = Right$("000" + LTrim$(Str$(nn2)), 3)
End Function
' replace above Functions with a generic string filler 2023-06-22
Function FillNumberStr$ (places As Integer, char$, number As Long)
' make sure places is >= to longest (in digits)
' number to display, char$ might work oddly
' with more than 1 alphanumeric.
FillNumberStr$ = Right$(String$(places, char$) + _Trim$(Str$(number)), places)
End Function
Looks like that worked, all my comments line up on column 60.
You've actually to do the export from the IDE, it inserts BBCode for coloring and wiki links. Just open a [ q b = e x p o r t] tag and then inserting plain code will just show plain code.
Code: (Select All)
_TITLE "test my 3 for 1 function" ' b+ 2023-06-22
FOR i = 1 TO 12
PRINT FillNumberStr$(i, "0", 1234), FillNumberStr$(i, " ", 1234), FillNumberStr$(i, "_", 1234)
NEXT
PRINT "Result make sure places is greater or equal to longest number to display"
PRINT "In the 1234 example that would be 4 digits for places"
FUNCTION TS$ (nn) ' this comment started on column 60
TS$ = RIGHT$("0000" + LTRIM$(STR$(nn)), 4)
END FUNCTION
FUNCTION TS1$ (nn1) ' this comment started on column 60
TS1$ = RIGHT$("00" + LTRIM$(STR$(nn1)), 2)
END FUNCTION
FUNCTION TS2$ (nn2) ' this comment started on column 60
TS2$ = RIGHT$("000" + LTRIM$(STR$(nn2)), 3)
END FUNCTION
' replace above Functions with a generic string filler 2023-06-22
FUNCTION FillNumberStr$ (places AS INTEGER, char$, number AS LONG)
' make sure places is >= to longest (in digits)
' number to display, char$ might work oddly
' with more than 1 alphanumeric.
FillNumberStr$ = RIGHT$(STRING$(places, char$) + _TRIM$(STR$(number)), places)
END FUNCTION
GuiTools, Blankers & other Projects:
https://staging.qb64phoenix.com/forumdisplay.php?fid=32
Libraries & useful Functions:
https://staging.qb64phoenix.com/forumdisplay.php?fid=23
https://staging.qb64phoenix.com/forumdisplay.php?fid=32
Libraries & useful Functions:
https://staging.qb64phoenix.com/forumdisplay.php?fid=23