Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create simple autocomplete form
Message
From
23/12/2013 12:45:35
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
20/12/2013 15:09:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01590652
Message ID:
01590888
Views:
158
>Mike: 'I would not use the silly modal form approach either'
>Hugo: "Ahem!...."
>Mike: "She's standing behind me isn't she. "
>
>karen

Hi Karen

I think you are not understanding my comment - and possibly not Hugo's either. For a form to remain visible after the .prg or method that linked it to a variable - that variable has to remain in scope. The scope is the .prg/method normally. To me, modality of a form is for making nothing else happen until that form is closed. That is not needed in the sample here. Further there is rarely need for a modal form. It is an often abused technique.

There is a need for the form to remain active for the demo. That should only be done via READ EVENTS. As this is a simple example, based on Cetin's example, I took a shortcut and used his public var approach - something I never do - just like I never make a form modal unless it positively must be modal. Adding the code for READ EVENTS was all beside the point of just making an autocomplete form.

>
>>>>*I rarely use public in production, but without it, this sample will end as soon as it reaches the last line of code.
>>>>
>>>>Public oForm
>>>>oForm = Createobject('AutoCompleteCountrySample')
>>>>oForm.Show
>>>
>>>
>>>Shame on you Mike, you do not *NEED* a public variable, a local variable and a modal form would have done it just right for this example :P
>>>
>>>
>>>LOCAL oForm
>>>oForm = Createobject('AutoCompleteCountrySample')
>>>oForm.Show(1)
>>>
>>
>>I would not use the silly modal form approach either.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform