dbTalk Databases Forums  

OpenQM - is there a way to assign class variables to an initial value

comp.databases.pick comp.databases.pick


Discuss OpenQM - is there a way to assign class variables to an initial value in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ted Friedman
 
Posts: n/a

Default OpenQM - is there a way to assign class variables to an initial value - 01-04-2011 , 01:32 AM






barring that - a way to detect an unassigned class variable so that it
can be assigned to a value before use

would prefer not to have to set up all variables before use - class
variables set to default value

I believe that earlier versions of OpenQM did it this way (same as C+
+).

Trying to set the class variable var = x within the class gives me the
error:

GET, SET and PUBLIC routines must appear before any other executable
code

Reply With Quote
  #2  
Old   
Ted Friedman
 
Posts: n/a

Default Re: OpenQM - is there a way to assign class variables to an initial value - 01-04-2011 , 01:58 AM






do I need to use the 'UNDEFINED' name operator (implemented as either
subroutine or function)
to deal with these property persistent values

have tried PUBLIC FUNCTION UNDEFINED()
RETURN ""
END

variables still regarded as unassigned

Reply With Quote
  #3  
Old   
Ted Friedman
 
Posts: n/a

Default Re: OpenQM - is there a way to assign class variables to an initial value - 01-04-2011 , 02:13 AM



I am using

OPTION UNASS.WARNING ON

for now but it isn't ideal

Reply With Quote
  #4  
Old   
Ted Friedman
 
Posts: n/a

Default Re: OpenQM - is there a way to assign class variables to an initial value - 01-04-2011 , 02:19 AM



I have found UNASSIGNED(var)

but it doesn't work with instance variables:

UNASSIGNED(CLASSNAME->INSTANCEVARNAME)

Reply With Quote
  #5  
Old   
Ted Friedman
 
Posts: n/a

Default Re: OpenQM - is there a way to assign class variables to an initial value - 01-04-2011 , 02:41 AM



right - discovered that it's not a problem with use of UNASSIGNED(var)
- only place detection of unassigned variable will be needed will be
within the class function

UNASSIGNED(CLASSNAME->CLASSINSTANCEVARIABLENAME) doesn't work but
that's not a problem

Reply With Quote
  #6  
Old   
Martin Phillips
 
Posts: n/a

Default Re: OpenQM - is there a way to assign class variables to an initial value - 01-04-2011 , 05:49 AM



You seem to have answered your own question!

If by "class variable" you are refering to variables declared as
PRIVATE or PUBLIC in a class module, these start out unassigned just
like locla variables in conventional programs and suborutines.

If you want to set them to some other value, you do this in the
CREATE.OBJECT subroutine (the equivalent of a constructor routine in
other OO programming languages). This optional subroutine is executed
once as the object is instantiated.

If this does not help, please post a more specific description of what
you are trying to achieve.


Martin Phillips, Ladybridge Systems

Reply With Quote
  #7  
Old   
Ted Friedman
 
Posts: n/a

Default Re: OpenQM - is there a way to assign class variables to an initial value - 01-04-2011 , 04:14 PM



On Jan 4, 11:49*am, Martin Phillips <MartinPhill... (AT) ladybridge (DOT) com>
wrote:
Quote:
You seem to have answered your own question!

If by "class variable" you are refering to variables declared as
PRIVATE or PUBLIC in a class module, these start out unassigned just
like locla variables in conventional programs and suborutines.

If you want to set them to some other value, you do this in the
CREATE.OBJECT subroutine (the equivalent of a constructor routine in
other OO programming languages). This optional subroutine is executed
once as the object is instantiated.

If this does not help, please post a more specific description of what
you are trying to achieve.

Martin Phillips, Ladybridge Systems
ok thanks

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.