Terry,
Sorry to bring bad news, but MapBasic isn't that strong concerning EditText
controls.
You can't
- specify how many characters the user can enter
- catch when the user enters a character in the edittext control
- catch when the user moves on to another control in the dialog.
So what you can do is:
- add a button that the user can use to verify his/her input
- add a handler to the OK button that will verify the user input
- in one of these handlers, you can check the value of the edittext control and
update the control with the necessary changes:
'**read the value from the control, change to upper case and only read
the first 5 characters
szVal = UCase$(Left$(ReadControlValue(MYEDITEXTCTRL_ID)))
'**Compare the changed value to the value in the dialog
If not Like(szVal, ReadControlValue(MYEDITEXTCTRL_ID), "") Then
'**There are not the same
'**If the entered text holds less than 5 characters they are
not the same either
Alter Control MYEDITEXTCTRL_ID Value szVal
Note "Please check the verified value!"
Dialog Preserver
Exit Sub
End if
HTH,
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
COWI har fået ny hjemmeside. Ydelserne GIS og IT, kort, kortlægning, 3D
visualisering og arealforvaltning ligger under SAMFUND. Se mere her :
www.cowi.dk
COWI has changed its homepage. Our services within cadastre and
landadministration, geodataproducts, mapping and GIS can be seen under SOCIETY.
See our services here: www.cowi.com
-----Original Message-----
From: Terry McDonnell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 12, 2005 6:23 PM
To: [email protected]
Subject: MI-L Lower to UPPER case
Hi Folks
Anybody know how to force the user input into upper case?
Alternatively, if can't be done, how to accept the lower case input and
redisplay it in the same input edittext box as upper case.
While I'm at it, I Dim'd a variable as:
Dim lcZGCode as String * 5
thinking this means the input will be restricted to 5 chars. But when I start
typing the edittext box seems to be happy to accept as many chars as I can
type.
So,m in a nut shell, I want to input no more than 5 chars, in upper case. The
dialog, btw, is as follows:
DIALOG
Title "Plot On-Demand/Demand Responsive Service Catchment Zone Group" Control
StaticText
Title "Zone Group Code:"
Control EditText
Width 20
into lcZGCode
...
'ppreciate it.
Terry
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 17121