Results 1 to 4 of 4

Thread: hmm what object is this

  1. #1
    Member
    Join Date
    Jul 2013
    Posts
    49

    hmm what object is this

    Hello all

    1. This question is about a conversion of an existing VFP application without rewriting into the Lianja vision.
    2. No pages or sections are created; a form is placed on the screen and is filled by processing metadata.
    3. The business rules or validation methods for each form are accessed by determining what object is being processed.

    The problem i am trying to conquer is that I so far have found no crash proof way of identifying the current object.
    I have a set of code I have attached to the form in the keypress method as follows:
    When I find the right event i add code to it to tell the prog what the current object is.

    I suspect if the grid weren't present then the query to active row would also crash.

    debugout 'CONSO'
    debugout grid1.activerow
    DEBUGOUT grid1.ActiveColumn
    *DEBUGOUT tabindex
    *DEBUGOUT this.activecontrol
    GROW=grid1.activerow
    GCOL= grid1.activeCOLUMN
    debugout mcurobj
    IF GROW=0 Or GCOL=0
    DEBUGOUT 'EXIT CONSO NULL GRID'
    *debugout this.baseclass
    RETURN
    ENDI
    NFLD=grid1.column(gcol).controlsource
    *DEBUGOUT oldval(grid1.ActiveColumn.controlsource)
    DEBUGOUT THIS.NAME
    retur


    Tabindex, name, activecontrol, baseclass all crash Lianja when they are null or its equivalent. If I could tell that no valid object was in focus,
    I could avoid the problem but everything crashes so thats not an option.

    Any suggestions or questions will be appreciated.

    Jim
    Last edited by barrymavin; 2016-02-27 at 22:34.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,350
    If something does not work as expected provide us with a SMALL reproducible example NOT the whole of your application as I have to install this on my development machine to determine what is causing the crash.

    Also be more specific about "crash". Is it your application or the app builder.

    Look at the is_object() function in the doc too.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Member
    Join Date
    Jul 2013
    Posts
    49
    Crash = "Lianja has stopped working' msg from windows.

    Is object() according to its documentation tells me if a specific name exists as an object. What I want is not if a name exists but rather what is the name of the specific object in focus. As i said in the first comment, The form is populated via metadata. The program must ask what the object is; it does not know what the object is and therefore does not know what validation rules to apply.

    The solution turns out to be simple as many are the correct command is
    This.activeccontrol.name

    but it took a long time to find :\

    thank you



    Jim

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    6,350
    Glad you figured it out but not does not help us fix the crash you are referring to unless you provide a small reproducible example.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us