Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PAUSE not working (*solved*)
#9
Sure. During the INPUT prompt, enter a character, then delete it and you'll see the cursor jump up to the line above.
Code:
#include <input.bas> DIM ans AS Integer DIM scoreToWin AS uByte FUNCTION userInputFN(inputXPos AS uByte, prompt AS String, default AS Byte, ansMaxLen AS uByte, ansMinVal AS Byte, ansMaxVal AS Byte) AS Integer     Prompt:     PRINT AT 23,inputXPos; prompt; " [";default;"]: ";     INK 1     answer$=INPUT(ansMaxLen)     INK 0     'String checks     IF answer$="" THEN         ans=default     ELSE         FOR n=0 TO (LEN answer$)-1             IF CODE answer$(n)<45 OR CODE answer$(n)>57 THEN                 PRINT AT 23,inputXPos; "Entry error",,                 PAUSE 50                 GO TO Prompt:             END IF         NEXT n         'Checks passed, convert to value         ans=INT(VAL(answer$))     END IF     IF ans<ansMinVal THEN ans=ansMinVal: PRINT AT 23,0; "Constrained to min",: PAUSE 50     IF ans>ansMaxVal THEN ans=ansMaxVal: PRINT AT 23,0; "Constrained to max",: PAUSE 50     PRINT AT 23,0;,,     RETURN ans END FUNCTION scoreToWin=5 scoreToWin=userInputFN(0, "Score to win match (1-9)", scoreToWin, 1, 1, 9) PRINT scoreToWin

I just tried beta 1.14 in Mac OS and it doesn't seem to have fixed the INPUT/PAUSE issue. The code I posted above still isn't PAUSEing properly even when compiled using 1.14.
Reply


Messages In This Thread
PAUSE not working (*solved*) - by patters - 2020-12-29, 04:56 AM
RE: PAUSE - by patters - 2020-12-29, 01:48 PM
RE: PAUSE - by boriel - 2020-12-29, 06:07 PM
RE: PAUSE - by patters - 2020-12-29, 06:11 PM
RE: PAUSE - by boriel - 2020-12-29, 06:20 PM
RE: PAUSE - by boriel - 2020-12-29, 06:37 PM
RE: PAUSE - by patters - 2020-12-29, 06:45 PM
RE: PAUSE - by boriel - 2020-12-29, 06:54 PM
RE: PAUSE - by patters - 2020-12-29, 07:08 PM
RE: PAUSE - by boriel - 2020-12-29, 08:18 PM
RE: PAUSE - by patters - 2020-12-29, 08:34 PM
RE: PAUSE - by boriel - 2020-12-29, 09:13 PM
RE: PAUSE - by patters - 2020-12-30, 12:52 AM
RE: PAUSE - by boriel - 2021-01-02, 03:20 PM
RE: PAUSE not working (*solved*) - by patters - 2021-01-03, 01:52 AM
RE: PAUSE not working (*solved*) - by boriel - 2021-01-03, 06:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)