BBC BASIC for Windows
Programming >> User Interface >> FNpsinput function
http://bb4w.conforums.com/index.cgi?board=ui&action=display&num=1395554854

FNpsinput function
Post by Wendell on Mar 23rd, 2014, 06:07am

*font Segoe print,11,B
PRINT TAB(32,10) "First Name: "

INPUT TAB(42,10)a$

PRINT TAB(30,11) " TENMADS : ";

INPUT TAB(45,21)b$




What is the format to correct the input statment.. for the above program will not, backspace correctly ?
Re: FNpsinput function
Post by kingsmiller on Mar 23rd, 2014, 08:28am

Quote:
*font Segoe print,11,B
PRINT TAB(32,10) "First Name: "

INPUT TAB(42,10)a$

PRINT TAB(30,11) " TENMADS : ";

INPUT TAB(45,21)b$



I have updated your code hoping that this is what you meant -

Code:
     *font Segoe print,11,B

      INPUTTAB(32,10)"First Name: ";a$

      INPUTTAB(32,12)"TENMADS ";b$
 


If you are querying on how to use the INPUT Keyword correctly then these two Wiki links may help and then is always the 'Help Topics' and 'Tutorial' -

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwin5.html#input

http://www.bbcbasic.co.uk/bbcwin/tutorial/chapter08.html

Regards ..

Re: FNpsinput function
Post by rtr on Mar 23rd, 2014, 10:15am

on Mar 23rd, 2014, 06:07am, Wendell wrote:
What is the format to correct the input statment.. for the above program will not, backspace correctly ?

You answered the question in your subject line: use the FNpsinput routine. However that routine, unmodified, does not work well with italic characters so in the code below I've added a SYS "SetBkMode" to resolve the issue:

Code:
      SYS "SetBkMode", @memhdc%, 1
      *font Segoe Print,11,B
      PRINT TAB(32,10) "First Name: ";
      a$ = FNpsinput(42,10,"")
      PRINT TAB(32,11) "TENMADS : ";
      b$ = FNpsinput(45,11,"") 

As the previous respondent noted you could incorporate the prompt string into the function call, but in so doing it's more difficult to position the cursor exactly where you want it, so I don't necessarily recommend it:

Code:
      SYS "SetBkMode", @memhdc%, 1
      *font Segoe Print,11,B
      a$ = FNpsinput(32,10,"First Name: ")
      b$ = FNpsinput(32,12,"TENMADS : ") 

Richard.

Re: FNpsinput function
Post by Wendell on Mar 23rd, 2014, 2:18pm

SYS "SetBkMode", @memhdc%, 1
*font Segoe Print,11,B
PRINT TAB(32,10) "First Name: ";
a$ = FNpsinput(42,10,"")
PRINT TAB(32,11) "TENMADS : ";
b$ = FNpsinput(45,11,"")



IF you run this ... a$ = FNpsinput(42,10,""),,,, no such FN/PROC error mess
Re: FNpsinput function
Post by rtr on Mar 23rd, 2014, 3:19pm

on Mar 23rd, 2014, 2:18pm, Wendell wrote:
no such FN/PROC error mess

I hardly dare ask this, but have you actually copied-and-pasted FNpsinput into your program?? rolleyes

You will save yourself a great deal of time and frustration if you develop a better understanding of the fundamentals of BBC BASIC. Once again I would strongly urge you to work through the Beginners' Tutorial, which you can access from the Help menu (the second item after Help Topics). Please note that the Tutorial is not the same thing as the BB4W Help documentation - one or two of your previous comments make me wonder whether you have muddled them up.

Richard.

Re: FNpsinput function
Post by Wendell on Mar 23rd, 2014, 3:25pm

Sorry i did copy it to my program ... And i am reading tutorial
sometime i get confuse .i will reread and try it again .
old guy