Home > Archive > Programming with dBASE > October 2005 > Dynamic Entryfield Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Dynamic Entryfield Problem
John Noble

2005-10-11, 7:27 am

When creating entryfields on the fly I came accross the following problem. I cannot set the maxLength property. It always remains stuck at the default (25)

I have inserted some test code below

Any help would be appreciated


** END HEADER -- do not remove this line
//
// Generated on 07/10/2005
//
parameter bModal
local f
f = new testingmaxlengthForm
()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif

class testingmaxlengthForm
of FORM
with (this)
onOpen = class::FORM_ONOPEN
height = 16.0
left = 32.5714
top = -0.3636
width = 40.0
text = ""
endwith

this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_O
NCLICK
height = 1.0909
left = 13.0
top = 13.0
width = 15.2857
text = "Pushbutton1"
endwith


function PUSHBUTTON1_onClick

form.myents.add(1)
form.myents[1] = new ENTRYFIELD(form)
with (form.myents[1])
height = 1.0
left = 2.0
top = 2
width = 30
maxlength = 30
endwith

form.myents[1].maxLength := 30 // even this makes no difference
return

function form_onOpen
form.myents = new array() // create array of entryfields
return

endclass
Rick Gearardo

2005-10-11, 7:27 am

Hi John,

The following works for me:

** END HEADER -- do not remove this line
//
// Generated on 10/07/2005
//
parameter bModal
local f
f = new efwidthForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif

class efwidthForm of FORM
with (this)
onOpen = class::FORM_ONOPEN
height = 7.4091
left = 38.8571
top = 3.3636
width = 51.2857
text = ""
endwith


function form_onOpen
a = new array()
for i = 1 to 5
a.add(new entryfield(form))
a[i].maxLength = 40
a[i].left = 0
a[i].top = a[i].height * (i-1)
a[i].width = form.width
a[i].value = " 12345678901234567890
12345678901234567890
"
next
return

endclass

"John Noble" <john@nor-tech.co.uk> wrote in message
news:n8WJwSzyFHA.1412@news-server...
> When creating entryfields on the fly I came accross the following problem.
> I cannot set the maxLength property. It always remains stuck at the
> default (25)
>
> I have inserted some test code below
>
> Any help would be appreciated
>
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 07/10/2005
> //
> parameter bModal
> local f
> f = new testingmaxlengthForm
()
> if (bModal)
> f.mdi = false // ensure not MDI
> f.readModal()
> else
> f.open()
> endif
>
> class testingmaxlengthForm
of FORM
> with (this)
> onOpen = class::FORM_ONOPEN
> height = 16.0
> left = 32.5714
> top = -0.3636
> width = 40.0
> text = ""
> endwith
>
> this.PUSHBUTTON1 = new PUSHBUTTON(this)
> with (this.PUSHBUTTON1)
> onClick = class::PUSHBUTTON1_O
NCLICK
> height = 1.0909
> left = 13.0
> top = 13.0
> width = 15.2857
> text = "Pushbutton1"
> endwith
>
>
> function PUSHBUTTON1_onClick
>
> form.myents.add(1)
> form.myents[1] = new ENTRYFIELD(form)
> with (form.myents[1])
> height = 1.0
> left = 2.0
> top = 2
> width = 30
> maxlength = 30
> endwith
>
> form.myents[1].maxLength := 30 // even this makes no difference
> return
>
> function form_onOpen
> form.myents = new array() // create array of entryfields
> return
>
> endclass



Zagrijs Venter

2005-10-11, 7:27 am

Hi Rick, John

The difference seems to be the "value" that Rick put in. The value sets the
maxLength automatically as the field length would if the entryfied is
datalinked. Without the value it sticks to 25 irrespective of what
maxLength determines. I tested it.

my turnkey:
form's metric property set to 6 //pixels

function PUSHBUTTON1_onClick
a = new ENTRYFIELD(form)
a.maxLength = 40
a.top = 10
a.left = 10
a.height = 22
a.width = 350
a.value = " 01234567890123456789
01234567890123456789
"

return

Comment maxLength out and the maximum length would still be 40. However, if
you comment the value out and leave maxLength uncommented the maximum length
would be 25.

Is this a bug?

Zagrijs


"Rick Gearardo" < wrote

> Hi John,
>
> The following works for me:
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 10/07/2005
> //
> parameter bModal
> local f
> f = new efwidthForm()
> if (bModal)
> f.mdi = false // ensure not MDI
> f.readModal()
> else
> f.open()
> endif
>
> class efwidthForm of FORM
> with (this)
> onOpen = class::FORM_ONOPEN
> height = 7.4091
> left = 38.8571
> top = 3.3636
> width = 51.2857
> text = ""
> endwith
>
>
> function form_onOpen
> a = new array()
> for i = 1 to 5
> a.add(new entryfield(form))
> a[i].maxLength = 40
> a[i].left = 0
> a[i].top = a[i].height * (i-1)
> a[i].width = form.width
> a[i].value = " 12345678901234567890
12345678901234567890
"
> next
> return
>
> endclass
>
> "John Noble" < wrote


>
>



Zagrijs Venter

2005-10-11, 7:27 am

Hi

Just added a second pushbutton to change maximum length to 50. Click on it
and maximum length remains 40, click on it again and maximum length is
changed to 50.

Looks more and more like a bug.

Zagrijs

"Zagrijs Venter" < wrote

> Hi Rick, John
>
> The difference seems to be the "value" that Rick put in. The value sets
> the maxLength automatically as the field length would if the entryfied is
> datalinked. Without the value it sticks to 25 irrespective of what
> maxLength determines. I tested it.
>
> my turnkey:
> form's metric property set to 6 //pixels
>
> function PUSHBUTTON1_onClick
> a = new ENTRYFIELD(form)
> a.maxLength = 40
> a.top = 10
> a.left = 10
> a.height = 22
> a.width = 350
> a.value = " 01234567890123456789
01234567890123456789
"
>
> return
>
> Comment maxLength out and the maximum length would still be 40. However,
> if you comment the value out and leave maxLength uncommented the maximum
> length would be 25.
>
> Is this a bug?
>
> Zagrijs
>
>
> "Rick Gearardo" < wrote
>
>
>



John Noble

2005-10-11, 7:27 am

Zagrijs Venter Wrote:

> my turnkey:
> form's metric property set to 6 //pixels
>
> function PUSHBUTTON1_onClick
> a = new ENTRYFIELD(form)
> a.maxLength = 40
> a.top = 10
> a.left = 10
> a.height = 22
> a.width = 350
> a.value = " 01234567890123456789
01234567890123456789
"
>
> return
>
> Comment maxLength out and the maximum length would still be 40. However, if
> you comment the value out and leave maxLength uncommented the maximum length
> would be 25.
>
> Is this a bug?


I'd say so.

Thanks for your help guys. Much appreciated

John
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com