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 / Can someone try this piece of code for me...

Author
Message
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 28th Dec 2002 20:54
I'm trying to write an Input routine and it produces a GPF on my machine, I just want to check it's not just my setup.

Thanks.

Jas

DO
My$=InputString(50,50,30,"Enter Name:","Jas")
MyNum=InputNumber(50,70,3,"Enter Str:",1)
LOOP
END

FUNCTION InputString(X AS INTEGER,Y AS INTEGER,InputLength AS INTEGER, Prompt$ AS STRING, PreviousString$ AS STRING)
SET TEXT FONT "Courier New"
SET TEXT SIZE 15
SET TEXT OPAQUE
InputWidth=TEXT WIDTH(SPACE$(InputLength))
PromptWidth=TEXT WIDTH(Prompt$)
InputX=X+PromptWidth+2
Res$=PreviousString$
CurrentPos=LEN(Res$)
IF InputLength""
PRINT PreviousString$;"_";
ENDIF
DO
Key$=ENTRY$()
IF RETURNKEY() THEN EXIT
IF Res$"" AND ASC(Key$)=8
Res$=LEFT$(Res$,LEN(Res$)-1)
Key$=""
SET CURSOR InputX,Y
PRINT Res$;"_ ";
ENDIF
IF Key$"" AND LEN(Res$)=48 AND ASC(Key$)
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 28th Dec 2002 20:56
Hmm, didnt work as expected, second time lucky...

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 28th Dec 2002 21:41
It seems to be a bug in one of the DLL's caused by the following line :

InputWidth=TEXT WIDTH(SPACE$(InputLength))

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 28th Dec 2002 21:59
Thanks,

It's a good job I dont need that any more, was planning to outline the box with a line but took that bit out.

Jas

Login to post a reply

Server time is: 2024-05-17 06:41:00
Your offset time is: 2024-05-17 06:41:00