ALLCAPS$()
Root / Submissions / [.]
AveryCreated:
Download:4KA34413Version:1.0.0Size:652B
A DEF block function that takes in a strings and turns all lower-case english letters in a string and makes them capital.
Made for comparing strings without case-sensitivity.
The common name for such a function is 'toupper'. Just sayin'.
Crap, you're right.
Replying to:NeatNit
Simple, to the point! I like it!
Suggestion for the next version: change the function names to a more standardized UPPER$(S$), and also add LOWER$(S$) because why not :)
Here's code for LCASE$()
DEF LCASE$(T$) FOR I=0TO LEN(T$)-1 IF ASC(T$[I])>64AND ASC(T$[I])>91THEN T$=SUBST$(T$,I,1,CHR$(ASC(T$[I])-32)) ENDIF NEXT RETURN T END
Replying to:12Me21
UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD))
SmileBASIC is influenced more by BASIC dialects used in Japanese retro computers, so comparing to qbasic isn't that accurate, I don't think. I'm pretty sure MOD is not s distinctive feature.
Replying to:12Me21
UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD))
I guess so... But UCASE$ is a more intuitive command.
Replying to:12Me21
UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD))
UPPER$ could be misinterpreted
Well yeah, in C++.
It's UCASE$ or UPPER$ in BASIC
It took me a while to realize that "toupper" was "to upper"...
Replying to:12Me21
UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD))
A function called upper that supposedly returns a string type. Hm... I bet it moves text up one console line.
With the new system, libraries go under programs.
Replying to:12Me21
UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD))
Probably returns the upper half of each character
Replying to:12Me21
UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD))
?UPPER$("ABC")
^Dr
Replying to:NeatNit
Simple, to the point! I like it!
Suggestion for the next version: change the function names to a more standardized UPPER$(S$), and also add LOWER$(S$) because why not :)
Try using the variable J instead of I, then accessing element number J will not be misinterpreted as a 'begin italics' markup.