Subscribe to our YouTube channel.Tutorials and more athttps://www.youtube.com/c/QB64Team.
0 Members and 1 Guest are viewing this topic.
Wouldn't an easy solution here be to just print to a temp screen, read the output into a string, and then swap the periods and commas?Here's a format$ routine that I worked up in the past. All it needs is to swap periods for commas, correct?Code: QB64: [Select] PRINT format$("###.###", "123.456789")PRINT format$("###,.##", "123456789.987654321") FUNCTION format$ (template AS STRING, text AS STRING) d = _DEST: s = _SOURCE n = _NEWIMAGE(80, 80, 0) _DEST n: _SOURCE n PRINT USING template; VAL(text) FOR i = 1 TO 79 t$ = t$ + CHR$(SCREEN(1, i)) NEXT IF LEFT$(t$,1) = “%” THEN t$ = MID$(t$,2) format$ = t$ _DEST d: _SOURCE s _FREEIMAGE nEND FUNCTION
Wouldn't an easy solution here be to just print to a temp screen, read the output into a string, and then swap the periods and commas?Here's a format$ routine that I worked up in the past. All it needs is to swap periods for commas, correct?
Thanks for showing this code, I wasn't familiar with the posibility of temp screens. This may open a lot of new ideas as your examples shows. I am going to play with this one!
It is the only screen I use, graphics are not for me.Only wishing it was somewhat more flexiible, bigger, resizeable, copy text from it (in win ctrl-C) ...I'm still thinking I haven't seen all new goodies from QB64, compared to QB4.5! ;-)
Amazing! But so offtopic ;-) I've got it working and will play around with this.
You might also try adding a $RESIZE command to your code. ;)