Alpha Video Training
Results 1 to 4 of 4

Thread: class - variable not found, or subelement not found

  1. #1
    Member
    Real Name
    Nate Marler
    Join Date
    Apr 2018
    Posts
    13

    Default class - variable not found, or subelement not found

    I've been developing a class over the past week or so and things have been going well, now this morning while debugging I'm receiving "variable not found" and/or "subelement not found" errors when the class functions attempt to use private members. Anyone else ever come accross this problem?

    - sometimes, but not always, I can get it to work by restarting the Alpha IDE
    - does this indicate that Alpha has some sort of caching mechanism?

    Weird part is that these are basic elements of the class that have been working without error for over a week, and it's also occuring with small test-case classes like in the attached screenshot

    Thanks
    Attached Images Attached Images

  2. #2
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,018

    Default Re: class - variable not found, or subelement not found

    Does your source file have a "define class global YOUR_CLASS_NAME" at the beginning and a "END class" at the end?

    https://documentation.alphasoftware....ic%20Class.xml

  3. #3
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,667

    Default Re: class - variable not found, or subelement not found

    If that's actually your xbasic class code... then something doesn't look right. Assuming, as Rich points out, that your class is properly defined, it's your Payment2 function that looks wrong.

    When I create a class with a function like your Payment2, I get a "Missing or invalid keyword" when I try to save the class. It's the line continuation stuff that looks in error. Try this...

    Code:
    	function Payment2 (uxName as c,compID as N,userRecID as N,userID as c,userShortName as c)
    	
    		'uxName : Name of the UX...
    		'compID : CompanyID of the...
    			
    		m_UXName = uxName
    		
    	end function

  4. #4
    Member
    Real Name
    Nate Marler
    Join Date
    Apr 2018
    Posts
    13

    Default Re: class - variable not found, or subelement not found

    Hi Guys, thanks for taking a look, but I'm afraid this whole thing might be a red herring. In my full class I had a function that returned a P variable with a return statement (e.g., "return myPvar"). When I changed it to instead use the assign-to-function-name syntax (e.g., "myFunc = myPvar") things started working again (after restarting the IDE). It was all very odd... that simply having those return statements in the source code and running through the debugger put the IDE into some sort of weird state.

    For what it's worth

    - yes, the class was defined properly; the debugger just doesn't display those parts
    - the line continuations are fine, I've used that style for a very long time throughout the project, it's never been a problem

    So all that being said, the root problem appeared to be the return statement. It was my understanding that the return statement is interchangeable with the assign-to-function-name syntax... is that true?

Similar Threads

  1. Help please. DB error. Property not found wf.A5SaveTimeStamp subelement not found
    By Cygnux in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 03-02-2017, 09:34 AM
  2. Replies: 6
    Last Post: 07-26-2016, 08:53 AM
  3. Property not found e.dataSubmitted.Main subelement not found.
    By lauraRedway in forum Windows Desktop Applications
    Replies: 5
    Last Post: 04-08-2015, 11:53 AM
  4. Property not found ... p.___workToDoObj subelement not found
    By CarlMPearson in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 01-21-2015, 05:28 AM
  5. Custrom Controlled field: Property not found / Subelement not found
    By meanrat in forum Web Application Server v7
    Replies: 2
    Last Post: 02-26-2007, 12:50 PM

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
  •