PDA

View Full Version : Missing attribute in Edit Field properties - Dev 7.01



NewsArchive
12-05-2001, 01:00 AM
According to the Help Files, the Edit Field properties in Developer 7.01
should have a "Max. Length" property. But I cannot find this when I select
an Edit Field. Anyone know where it is or how I can limit the number of
characters a user enters in and Edit Field? tia,

Marc

NewsArchive
12-06-2001, 01:00 AM
The Edit Field Properties help is in the "Dialogs - Basic MSI Projects"
chapter and describes the control properties for the Edit Field in a Basic
MSI project, so it is in there but apparently not available for Standard
Projects.
A possible way to limit the number of characters is to enforce it in the
installscript function that implements the dialog's initialization and
control handling.
For example:

function NUMBER MyDialog(...)
....
begin
...
while ( !bDone )
...
nResult = WaitOnDialog( MY_DIALOG );
// Switch to check WaitOnDialog return value and process control
// processes the appropriate control
switch ( nResult )
case DLG_INIT:
some_initialization();

case NEXT_BUTTON: // The user clicked the next button.
nDlgReturn = NEXT;
bDone = TRUE;

case MY_EDIT_FIELD:
CtrlGetText( MY_DIALOG, MY_EDIT_FIELD, svValue );
if (StrLength(svValue) > MY_MAX_LENGTH) then
CtrlSetText( MY_DIALOG, MY_EDIT_FIELD,
svMyEditFieldValue );
else
svMyEditFieldValue = svValue;
endif;
...
endswitch;
...
endwhile;
...
return nDlgReturn;
end;

svMyEditFieldValue is the variable holding the value you are interested in
svValue is the variable where you put the Edit Field contents and which you
check for its length against
MY_MAX_LENGTH a define with the Edit Field max length.

Hope this helps,

Eric-Paul

"Marc Peterson" <marcp@condoreng.com> wrote in message
news:3c0ec0e9$1@news.installshield.com...
> According to the Help Files, the Edit Field properties in Developer 7.01
> should have a "Max. Length" property. But I cannot find this when I
select
> an Edit Field. Anyone know where it is or how I can limit the number of
> characters a user enters in and Edit Field? tia,
>
> Marc
>
>
>

NewsArchive
12-06-2001, 01:00 AM
The Edit Field Properties help is in the "Dialogs - Basic MSI Projects"
chapter and describes the control properties for the Edit Field in a Basic
MSI project, so it is in there but apparently not available for Standard
Projects.
A possible way to limit the number of characters is to enforce it in the
installscript function that implements the dialog's initialization and
control handling.
For example:

function NUMBER MyDialog(...)
....
begin
...
while ( !bDone )
...
nResult = WaitOnDialog( MY_DIALOG );
// Switch to check WaitOnDialog return value and process control
// processes the appropriate control
switch ( nResult )
case DLG_INIT:
some_initialization();

case NEXT_BUTTON: // The user clicked the next button.
nDlgReturn = NEXT;
bDone = TRUE;

case MY_EDIT_FIELD:
CtrlGetText( MY_DIALOG, MY_EDIT_FIELD, svValue );
if (StrLength(svValue) > MY_MAX_LENGTH) then
CtrlSetText( MY_DIALOG, MY_EDIT_FIELD,
svMyEditFieldValue );
else
svMyEditFieldValue = svValue;
endif;
...
endswitch;
...
endwhile;
...
return nDlgReturn;
end;

svMyEditFieldValue is the variable holding the value you are interested in
svValue is the variable where you put the Edit Field contents and which you
check for its length against
MY_MAX_LENGTH a define with the Edit Field max length.

Hope this helps,

Eric-Paul

"Marc Peterson" <marcp@condoreng.com> wrote in message
news:3c0ec0e9$1@news.installshield.com...
> According to the Help Files, the Edit Field properties in Developer 7.01
> should have a "Max. Length" property. But I cannot find this when I
select
> an Edit Field. Anyone know where it is or how I can limit the number of
> characters a user enters in and Edit Field? tia,
>
> Marc
>
>
>