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 / right$() not working?

Author
Message
IAK
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 4th Oct 2002 21:36
hi,
in db if i use right$(text$,1) on a string, say "Hello", then it will return "o". but, in dbpro, it returns the entire string. is anyone else aware of this problem? the code works fine in Db, just not in dbpro.

thanks,
iak.
- IAK

http://www.iakstudios.com
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 4th Oct 2002 23:04
Seems to be working ok for me in dbpro.

IAK
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 5th Oct 2002 00:42
right ho, it must be me then! i dunno what im doing wrong tho, cos it works in DB fine. im using to do a delete key for an input function. e.g.
if keystate(14)=1 then text$=text$-right$(text$,1)
this erases only the last character in db, but the enter string in dbpro. ahh well, i had better analyse my code a bit more i guess.

thanks for ur help guys

- IAK

http://www.iakstudios.com
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Oct 2002 00:57
How about doing a :

text$=left$(text$,len(text$)-1)

for every delete key pressed ?

Yes, I really am THAT good...
SoulTaker
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location:
Posted: 5th Oct 2002 07:35
Works here fine also
IAK
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 5th Oct 2002 13:50
thanks for that MrTAToad, it works fine. i dunno why right$() doesnt work tho - in dbpro ur code has the same effect that right$() has in db. wierd. anyway, thanks to everyone for telling me that it does work

- IAK

http://www.iakstudios.com
VietStylist
21
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Australia
Posted: 6th Oct 2002 12:31
if keystate(14)=1 then text$=text$-right$(text$,1)

Wouldn't that take away all of the characters in the string that is the same as the last character of the string?
ie.

text$="eieieieie"
text$=text$-right$(text$,1)
text$="iiiii"

Vs

Login to post a reply

Server time is: 2024-04-26 04:38:23
Your offset time is: 2024-04-26 04:38:23