Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning A value from a Class???
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00668213
Message ID:
00668643
Views:
20
Thanks for all of the help. I finally got it.
I had to start over but it only took about 10 minutes.
This is the list of properties that I used
**** start of form Properties*******
 Height = 220
 Width = 202
 ShowWindow = 0
 DoCreate = .T.
 Caption = "Get State"
 Closable = .T.
 TitleBar = 0
 thisstate = 
 Name = "getstateform"
 SA_label1.Visible = .F.
 SA_label1.Name = "SA_label1"
****** End of Form Properties
****** Start of Listbox Properties
 ColumnCount = (ALEN(laMyStates,2))
 ColumnWidths = "45,110"
 RowSourceType = 5
 RowSource = "laMyStates"
 ControlSource = "thisform.thisstate"
 FirstElement = 1
 Height = 174
 Left = 6
 NumberOfElements = (ALEN(laMyStates))
 Top = 18
 Width = 189
 BoundTo = .T.
 Name = "sa_list1"
****** End of Listbox Properties
and the methods were straight forward as well
** form's Init method
PROCEDURE Init

  SELECT CODE,CODEDESC FROM USERCODE ;
    INTO ARRAY laMyStates ;
    WHERE CODETYPE = 'STATE' ;
    ORDER BY code  
ENDPROC

**** Listbox methods
PROCEDURE DblClick
  this.Parent.thisstate = this.Value
  thisform.Hide()
ENDPROC

PROCEDURE InteractiveChange
  WAIT WINDOW 'This state is: ' + this.Value nowait
ENDPROC
In the button that calls it I have:
PROCEDURE Click   
  oMyState = CREATEOBJECT('getstateform')
  oMystate.show()
  lcMyState = oMyState.thisState
  THIS.PARENT.RFI_TEXTBOX1.VALUE = ALLTRIM(lcMystate)
  THIS.PARENT.VALUE = ALLTRIM( lcMystate)
  THIS.PARENT.VALID()
  oMystate.release()
ENDPROC
What is Wisdom?
Wisdom - The ability to respond to any situation according to God's Plan.
Therefore:
USE Wisdom IN Everything ORDER priority AS Knowledge
SELECT Knowledge
BROWSE FOR Understanding WHERE Wisdom=Guide

LeRoy Jackson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform