? ALLCAPS$() ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
Another contest? You asked for it!

ALLCAPS$()

Submitted
Updated
Author
ColeslawProductions
Public Key
4KA34413
Min. Compat.
All
Version
1.0.0
Size
652B
Rating
2 votes
Description 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.
Categories
Keywords
  • function
  • uppercase
  • lowercase
  • case
17 Comment(s) 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself UCASE$(string$) and LCASE$(string$) are the standard functions (from qbasic, which SmileBASIC is mostly based of (for example, MOD)) Lumage Lumage Head Admin 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. 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself I guess so... But UCASE$ is a more intuitive command. 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself UPPER$ could be misinterpreted Lumage Lumage Head Admin A function called upper that supposedly returns a string type. Hm... I bet it moves text up one console line. 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Probably returns the upper half of each character 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself ?UPPER$("ABC") ^Dr 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself I think this belongs in "resources" Lumage Lumage Head Admin With the new system, libraries go under programs. NeatNit 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 :) 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself 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 SquareFingers SquareFingers Try using the variable J instead of I, then accessing element number J will not be misinterpreted as a 'begin italics' markup. SquareFingers SquareFingers The common name for such a function is 'toupper'. Just sayin'. ColeslawProductions ColeslawProductions Crap, you're right. 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Well yeah, in C++. It's UCASE$ or UPPER$ in BASIC 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself It took me a while to realize that "toupper" was "to upper"... kldck_hul kldck_hul First Month Joined in the very first month of SmileBASIC Source Website Scholar Received for knowing a great deal about programming topics Achievements Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself 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") !