screen size dialog units
#Function prototypes for example.dll
include "example.inc"
# VARIABLE DEFINITIONS
string String Temp
integer Errorlevel_IV
# DIALOG REGION/CONTROL DEFINITIONS
enabled invisible temporary primary dialog region Object_DR
size 225 174
at position 23 8
in desktop size border
title bar "String Functions"
system menu
horizontal scroll bar scroll by 6
vertical scroll bar scroll by 2
minimize button
maximize button
enabled visible static text Input_ST
size 50 10
at position 18 145
in Object_DR
in desktop left align top align
text "Enter Text"
enabled visible entry field Input_EF
size 97 12
at position 112 145
in Object_DR
in desktop
text size 32 columns
left align
enabled visible static text Caps_ST
size 84 11
at position 18 130
in Object_DR
in desktop left align top align
text "Your text has caps"
disabled visible entry field Caps_EF
size 50 12
at position 112 130
in Object_DR
in desktop
text size 32 columns
left align
enabled visible static text Lows_ST
size 80 12
at position 18 114
in Object_DR
in desktop
left align top align
text "Your text has lows"
disabled visible entry field Lows_EF
size 50 12
at position 112 114
in Object_DR
in desktop
text size 32 columns
left align
enabled visible static text InLows_ST
size 72 13
at position 18 95
in Object_DR
in desktop
left align
top align
text "Text in all lows"
disabled visible entry field InLows_EF
size 98 12
at position 112 96
in Object_DR
in desktop
text size 32 columns
left align
enabled visible static text InCaps_ST
size 72 11
at position 18 77
in Object_DR
in desktop
left align
top align
text "Text in all caps"
disabled visible entry field InCaps_EF
size 98 12
at position 112 77
in Object_DR
in desktop
text size 32 columns
left align
enabled visible static text Backwards_ST
size 78 13
at position 18 59
in Object_DR
in desktop
left align
top align
text "Text backwards"
disabled visible entry field Backwards_EF
size 98 12
at position 112 59
in Object_DR
in desktop
text size 32 columns
left align
enabled visible default push button OK_PB
size 50 13
at position 71 17
in Object_DR
in desktop
text "~OK"
# ACTION DEFINITIONS
action CheckErrorlevel is
if( errorlevel != ERROR_FREE ) then
copy errorlevel to Errorlevel_IV
send "\nERROR: " Errorlevel_IV "\n" to errorlog
end if
action ProcessInput is
# copy the text from the entry field to a string
copy text of Input_EF to String
# check for uppercase
if(HasUpper(String)) then
change Caps_EF text to "TRUE"
else
change Caps_EF text to "FALSE"
end if
# check for lowercase
if(HasLower(String)) then
change Lows_EF text to "TRUE"
else
change Lows_EF text to "FALSE"
end if
# convert to uppercase
copy String to Temp
call MakeUpper(Temp)
action CheckErrorlevel
change InCaps_EF text to Temp
# convert to lowercase
copy String to Temp
copy MakeLower(Temp) to Errorlevel_IV
if( Errorlevel_IV != ERROR_FREE ) then
send "\nERROR: " Errorlevel_IV "\n" to errorlog
end if
change InLows_EF text to Temp
# Reverse the order of the characters
call MakeBackwards(String)
action CheckErrorlevel
change Backwards_EF text to String
# Put the keyboard focus/cursor back in the
# original entry field
activate Input_EF
# RESPONSE DEFINITIONS
response to start
make Object_DR permanent
make Object_DR visible
# Put the keyboard focus/cursor in first entry field
activate Input_EF
response to OK_PB
action ProcessInput