String to lowercase

بواسطة Mafcase

Master (255)

صورة Mafcase

16-07-2019, 15:56

Hi there,

Is there someone who knows how to convert a string in MSX basic to lowercase?

The only thing i could find is: A$=CHR$(ASC(A$) AND &HDF).
But it's the other way around (this converts A$ to uppercase)

Thanks in advance

Login أوregister لوضع تعليقاتك

بواسطة edoz

Prophet (2443)

صورة edoz

16-07-2019, 16:06

Are you working on a network application in basic? Wink Just wonder the need Wink

بواسطة assembler

Champion (404)

صورة assembler

16-07-2019, 16:06

A$=CHR$(ASC(A$) AND &HDF or 32)

بواسطة Mafcase

Master (255)

صورة Mafcase

16-07-2019, 16:07

Uhm... Nope, no network app....

Just trying to fiddle around with some basic stuff Smile

بواسطة Mafcase

Master (255)

صورة Mafcase

16-07-2019, 16:12

@ assembler: Thank you! Will try that one..

Not working the way i would like...

I would like to see the whole string being converted not only the first character...

Sorry if i wasn't clear Wink

بواسطة wolf_

Ambassador_ (9971)

صورة wolf_

16-07-2019, 16:18

For t=0 to Len(a$)-1
output$=mid(a$,1+t,1) with magical math
Next t

بواسطة Mafcase

Master (255)

صورة Mafcase

16-07-2019, 16:32

@ Wolf_: Thank you very much!

بواسطة Manuel

Ascended (18860)

صورة Manuel

16-07-2019, 20:54

Alternative, just for the fun of it... (but be careful with it):

20 P=VARPTR(A$):L=PEEK(P):AD=PEEK(P+1)+256*PEEK(P+2)

still, it's a nice demo of VARPTR... Fun fact: if the string is a constant in the program, this code will modify the program itself Smile
This is the way you would do it in C, approximately Smile