Subject Re: ENTRYFIELD
From Mervyn Bick <invalid@invalid.invald>
Date Mon, 1 Oct 2018 07:37:58 +0200
Newsgroups dbase.getting-started
Attachment(s) test_ef_picture.wfm

On 2018-09-30 4:48 PM, Mustansir Ghor wrote:
> Dear Mervyn
>
> There was issue with error that resulted from ENTRYFIELD, I am now
> realising importance of question asked below by you. It can be the problem.
>
> The error comes when first digit is entered. Later even after emptying
> the entryfield and re entering first the digit the error does not
> appear. If I enter first time a character the error does not appear
> although the character is not accepted due to picture function
>
> The ENTRYFIELD is
>
> 1. Entry field is on its own
> 2. It value property is assign as character
> 3. Enryfield expects digits
> 4. The error arises on entering the first character which happens to be
> a digit.
> 5. Entryfield is not custom control
> 6. Entry fields is not datalinked
> 7. Entry field picture propery is set "99999"
> 8. Event handlers associated with this object  were put in this thread
>

I've used the constructor code you posted previously for the entryfield
and its onKey event handler in a little test form.

I'm afraid I can't duplicate this problem using dBASE PLUS 12.30  b2585
(09/07/2018-EN180907) with Windows 10 Pro, 64-bit, version 1803.

Please try the little test form attached and see what it does.

Mervyn.



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

class test_ef_pictureForm of FORM
   with (this)
      height = 16.0
      left = 105.0
      top = 0.0
      width = 40.0
      text = ""
   endwith

   this.ENTRYFIELD1 = new ENTRYFIELD(this)
   with (this.ENTRYFIELD1)
      onLostFocus = class::ENTRYFIELD1_ONLOSTFOCUS
      onKey = class::ENTRYFIELD1_ONKEY
      height = 1.3182
      left = 12.0
      top = 2.0
      width = 11.0
      picture = "999999"
      fontSize = 14.0
      value = "      "
      pageno = 0
   endwith

   this.ENTRYFIELD2 = new ENTRYFIELD(this)
   with (this.ENTRYFIELD2)
      height = 1.0
      left = 13.0
      top = 8.5
      width = 8.0
      value = "Entryfield2"
   endwith


   function ENTRYFIELD1_onKey(nChar, nPosition,bShift,bControl)
                
    if len(ltrim(this.value)) == 6
        this.keyboard("{tab}")
       endif
    return

   function ENTRYFIELD1_onLostFocus()
      
      return

endclass



Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0