|
Post by carlos45 on Jan 9, 2024 22:52:13 GMT
Good evening, Bplus. How to change the prompt using input so that it is not vertical? I want it to be in standard mode. Is there a way to make this change without changing the lines of code? Screen _NewImage(820, 740, 256)? _Title "Qbasic 64" Screen _NewImage(820, 740, 256) _Delay .25 _ScreenMove 5, 10
Do Color 31: Locate 8, 3 Print "Digige as dezenas de 15 a 19 "; Color 48: Line Input ; "", NumDezenas$ Color 31: Locate 10, 3 Print "Deseja continuar? (S/N)? "; Color 48: Line Input ; "", resposta$ resposta$ = UCase$(resposta$) Loop Until resposta$ = "S"
Attachments:
|
|
|
Post by bplus on Jan 10, 2024 0:44:15 GMT
You can make your own custom input routine and while you are at it allow pastes in from the Clipboard!
You will have to use graphics screen for line drawing or maybe the underline character for screen 0? I did one that used the {} to enclose the area the user types into.
There is nothing that I know of that controls output screen cursor.
|
|
|
Post by Steve on Jan 13, 2024 8:38:08 GMT
You can make your own custom input routine and while you are at it allow pastes in from the Clipboard! You will have to use graphics screen for line drawing or maybe the underline character for screen 0? I did one that used the {} to enclose the area the user types into. There is nothing that I know of that controls output screen cursor. qb64phoenix.com/qb64wiki/index.php/LOCATE(Look at the last 2 paramters. )
|
|
|
Post by bplus on Jan 13, 2024 20:03:44 GMT
Yeah Steve, I never used Locate beyond the first 2 arguments that I can reacall.
|
|
|
Post by carlos45 on Jan 19, 2024 22:23:29 GMT
_Title "Qbasic 64" Screen _NewImage(820, 740, 256) _Delay .25 _ScreenMove 5, 10
Do Color 31: Locate 8, 3, 1, 8, 8 Print "Digige as dezenas de 15 a 19 "; Color 48: Input ; "", NumDezenas$ Color 31: Locate 10, 3, 1, 8, 8 Print "Deseja continuar? (S/N)? "; Color 48: Input ; "", resposta$ resposta$ = UCase$(resposta$) Loop Until resposta$ = "S"
Good evening, Bplus and Steve, Thank you both for your valuable input and support regarding my forum question. Bplus, I thank you immensely for your prompt response, which has already brought clarity and guidance to my question. However, Steve added a more precise answer, further deepening the understanding of my problem. Both of you have been instrumental in my search for solutions, in sharing your knowledge. I would also like to mention that when implementing the line Screen_NewImage(820, 740, 256), I noticed that the cursor was not appearing as expected. If you have any additional guidance on this point, I would be immensely grateful. Once again, thank you for your dedication and willingness to help. Carlos Attachments:
|
|
|
Post by bplus on Jan 20, 2024 0:07:30 GMT
Hi Carlos, I don't know what you were expecting. The wiki help on this isn't so helpful. After some experimenting, I can see why I had resorted to using my own Input for graphic screens. I suspect the last 2 parameters only work in Screen 0?
_Title "Graphics Input, inputG test" 'b+ 2019-11-01 Screen _NewImage(800, 600, 32) _ScreenMove 300, 20 Dim Shared f& f& = _LoadFont("arial.ttf", 18, "monospace") ' 2021-08-17 check with fonts _Font f& y = 200: x = 100 Do P$ = "Enter something > " expectedEnterLen% = 20 inputG x, y, P$, inpt$, expectedEnterLen% If inpt$ = "" Then Exit Do Print "You entered: "; inpt$ y = y + 25 x = x + 30 If x + (Len(P$) + expectedEnterLen% + 5) * 8 > _Width Then x = 1 Loop Print "Test is done when empty string returned by inputG."
'INPUT for Graphics screen Sub inputG (x, y, prmpt$, var$, expectedLenVar%) 'input for a graphics screen x, y is where the prompt will start , returns through var$ Dim tmp$, k$ saveAD = _AutoDisplay _KeyClear _PrintString (x, y), prmpt$ + " {}" Do k$ = InKey$ If Len(k$) = 1 Then Select Case Asc(k$) Case 13: var$ = tmp$: Exit Sub Case 27: var$ = "": Exit Sub Case 8 'backspace If Len(tmp$) Then If Len(tmp$) = 1 Then tmp$ = "" Else tmp$ = Left$(tmp$, Len(tmp$) - 1) End If Case Else: If Asc(k$) > 31 Then tmp$ = tmp$ + k$ End Select _PrintString (x, y), prmpt$ + " {" + tmp$ + "}" + Space$(expectedLenVar% - Len(tmp$)) 'spaces needed at end to clear backspace chars If saveAD <> -1 Then _Display End If Loop End Sub
I also have a heavy duty (code wise) InputBox Function routine.
|
|