LoginLogin
Might make SBS readonly: thread

ALLCAPS$()

Root / Submissions / [.]

AveryCreated:
Download:4KA34413
Version: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.

Instructions:

Copy the DEF block into any program to any program to use ALLCAPS$() as a normal function. Syntax: ALLCAPS$(String to convert)

Notes:

Changelog Version 1.0.0 (K5V438QE) Initial release. Version 1.1.0 (4KA34413) Fixed a glitch that kept "y" and "z" from being capitalized.

This is awesome. I've been meaning to write one of these, but haven't had the time. I might very well put this to use parsing lines in Lowerdash. Begone contains$("dict") OR contains$("DICT") !

The common name for such a function is 'toupper'. Just sayin'.

Replying to:SquareFingers
The common name for such a function is 'toupper'. Just sayin'.
Crap, you're right.

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 :)

I think this belongs in "resources"

UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD))

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

Replying to:SquareFingers
The common name for such a function is 'toupper'. Just sayin'.
Well yeah, in C++. It's UCASE$ or UPPER$ in BASIC

Replying to:SquareFingers
The common name for such a function is 'toupper'. Just sayin'.
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.

Replying to:12Me21
I think this belongs in "resources"
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.

Thank you!