Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Limit input text help

Author
Message
gamehazer
1
Years of Service
User Offline
Joined: 2nd May 2018
Location:
Posted: 8th Aug 2018 15:28 Edited at: 8th Aug 2018 15:30
So I searched and searched and read for hours and experimented and its driving me crazy.

I can not find out a way to limit the text char to the input command.

Here is the simple starting enter name code I have, its just to test the menu , I will set up a more real munu after I get thing working right.





Now I have tried many things, but the text still writes to screen.
gamehazer
1
Years of Service
User Offline
Joined: 2nd May 2018
Location:
Posted: 8th Aug 2018 21:21
Any help? Please
Scorpyo
16
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 9th Aug 2018 07:59 Edited at: 9th Aug 2018 07:59
Not sure what you are trying to achieve

Try this:

clear entry buffer
wait key
repeat
name$=name$+entry$()
clear entry buffer
text 555,375,">"+name$+"<"
sync
rem cls
until returnkey()=1
if len(name$)>0 then gosub menu
gamehazer
1
Years of Service
User Offline
Joined: 2nd May 2018
Location:
Posted: 9th Aug 2018 14:26
I'm trying to limit the text , your code works but I need to be able to limit the letter amount .
Scorpyo
16
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 9th Aug 2018 17:01

Not sure it's gonna work

clear entry buffer
wait key
repeat
name$=name$+entry$()
clear entry buffer
text 555,375,">"+name$+"<"
sync
until len(name$)="letteramount" : gosub menu


gamehazer
1
Years of Service
User Offline
Joined: 2nd May 2018
Location:
Posted: 9th Aug 2018 20:28
I wish it was so my good friend, but I got it to work , and I could not do it with out you, let me show you.



The only problem is it keeps cls in every loop making the screen flash a bit.

Thank you for your help.

Login to post a reply

Server time is: 2019-08-24 10:14:28
Your offset time is: 2019-08-24 10:14:28