ToLower
Syntax
Destination String = ToLower (Source String)
Overview
Convert the characters from a source string to lower case.
Parameters
Destination String can only be a String variable, and should be large enough to hold the correct amount of characters extracted from the Source String. Source String can be a String variable, or a Quoted String of Characters. The Source String can also be a Byte, Word, Dword, Float or Array, variable, in which case the value contained within the variable is used as a pointer to the start of the Source String's address in RAM. A third possibility for Source String is a Label name, in which case a null terminated Quoted String of Characters is read from code memory.
Example 1
' Convert the characters from SourceString to lowercase into DestString
Device = 24HJ128GP502 ' Select the device to compile for
Declare Xtal = 16
Dim SourceString as String * 20 ' Create a String of 20 characters
Dim DestString as String * 20 ' Create another String
SourceString = "HELLO WORLD" ' Load the source string with characters
DestString = ToLower(SourceString) ' Convert to lowercase
Print DestString ' Display the result, which will be "hello world"
Example 2
' Convert the characters from a Quoted Character String to lowercase
' into DestString
Device = 24HJ128GP502 ' Select the device to compile for
Declare Xtal = 16
Dim DestString as String * 20 ' Create a String of 20 characters
DestString = ToLower("HELLO WORLD") ' Convert to lowercase
Print DestString ' Display the result, which will be "hello world"
Example 3
' Convert to lowercase from SourceString into DestString using a pointer to
' SourceString
Device = 24HJ128GP502 ' Select the device to compile for
Declare Xtal = 16
Dim SourceString as String * 20 ' Create a String of 20 characters
Dim DestString as String * 20 ' Create another String
' Create a Word variable to hold the address of SourceString
Dim StringAddr as Word
SourceString = "HELLO WORLD" ' Load the source string with characters
' Locate the start address of SourceString in RAM
StringAddr = AddressOf(SourceString)
DestString = ToLower(StringAddr) ' Convert to lowercase
Print DestString ' Display the result, which will be "hello world"
Example 4
' Convert chars from a code memory string to lowercase
' and place into DestString
Device = 24HJ128GP502 ' Select the device to compile for
Declare Xtal = 16
Dim DestString as String * 20 ' Create a String of 20 characters
' Create a null terminated string of characters in code memory
Dim Source as Code = "HELLO WORLD", 0
DestString = ToLower(Source) ' Convert to lowercase
Print DestString ' Display the result, which will be "hello world"
See also : Creating and using Strings, Creating and using code memory strings,

