Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help: Issues with the _PRINTSTRING and _INPUTBOX$ functions in QB64.
#1
During my study of QB64, I've encountered two confusing issues:

_PRINTSTRING: When used within a VIEW viewport, it doesn't seem to support relative coordinates, whereas _UPRINTSTRING works fine with them. Given how similar they are, it seems like _PRINTSTRING should also be able to use relative coordinates.

Chinese input via _INPUTBOX$: I can input Chinese characters normally in the pop-up dialog, but the returned string is garbled. Typically, a Chinese character in GBK encoding is 2 bytes, but the string returned by this function appears to be 4 bytes per character. The character encoding doesn't seem to match GBK, UTF-8, or UTF-16, making it impossible to convert and use correctly. While _MESSAGEBOX can normally display Chinese text, the characters returned by _INPUTBOX$ cannot even be displayed properly by the _MESSAGEBOX statement.

I hope to get some help from everyone. Thank you.

Code: (Select All)

Screen 12
test$ = "Hello world!"
View (10, 180)-(610, 380), , 3
_PrintString (0, 0), test$ + " _printstring"
_UPrintString (300, 0), test$ + " _uprintstring"
View
Do: k$ = InKey$: Loop Until k$ <> ""
Cls
chn$ = "QB64pe初学者"
_MessageBox "Message Correct", chn$, "info"
_MessageBox "Show InputBox Result", _InputBox$("Inputbox", "The default text displays correctly.", chn$), "warning"


[Image: image.png]


[Image: image.png]


[Image: image.png]
Reply


Messages In This Thread
Help: Issues with the _PRINTSTRING and _INPUTBOX$ functions in QB64. - by qbfans - 12-14-2025, 05:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  using a custom tileset as a fixed-width font for _PrintString ? madscijr 11 2,301 06-05-2025, 05:50 PM
Last Post: madscijr
  Use of Functions PhilOfPerth 53 7,257 05-30-2025, 01:49 PM
Last Post: TempodiBasic
  why am I not seeing my _printstring output? Cobalt 2 652 05-19-2025, 05:54 PM
Last Post: Cobalt
  Shell issues eoredson 7 1,342 05-10-2025, 02:59 AM
Last Post: eoredson
  Command$ issues eoredson 8 1,404 05-02-2025, 01:42 AM
Last Post: eoredson

Forum Jump:


Users browsing this thread: 1 Guest(s)