Posts: 11
Threads: 6
Joined: Jan 2014
Hi Gintaras,
Nice easy one (even though I cant see a straight answer anywhere, If i have a simple string, how do i change it from "quick macros" to "QUICK MACROS"?
i.e changing everything to uppercase whether they were originally or not.
Posts: 771
Threads: 264
Joined: Jul 2012
Macro
Macro2
;; ------ CONVERT TO UPPERCASE
str sa="abc"
int i
for i 0 sa.len ;; Iterate through each letter, first 'a' then 'b' then 'c', but now we iterate trough each corresponding character code (QM HELP > chapter 'character codes')
,sa[i]=toupper(sa[i]) ;; Current letter in character code format transformed to UPPERCASE.
out sa ;; each letter from string 'sa' has been transformed to uppercase, output should be: 'ABC'
;; you can change 'toupper' to 'tolower' to convert to lowercase
;; ------ INVERT CASE
;; If you understand above code then you should be able to figure out below code
str sb="xYz"
for i 0 sb.len
,if(isupper(sb[i]))
,,sb[i]=tolower(sb[i])
,else
,,sb[i]=toupper(sb[i])
out sb ;; should output 'XyZ'
Posts: 29
Threads: 7
Joined: Apr 2016
hope somebody can help here
if I want to change the case to capitalize first letter for every word for the selected text how that could be done?
thanks