Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finally Moving to VFP on XP
Message
From
11/09/2004 06:00:40
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/09/2004 20:12:57
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00941253
Message ID:
00941292
Views:
13
>I have finally been given permission to port (unfortunately, not yet rewrite - that should come later) a FPW 2.6 application into VFP. I have VFP 6.0 and we have VFP 8.0 on order.
>
>The workstation which will build the exe and app files is NT based. The workstations which will eventually run them are XP.
>
>I can use lots of advice on the kind of "gotchas" which will cause problems.
>
>And here's an additional silly question.
>
>In FPW26 I could place the ESL file in the same directory as the EXE file and run an application from the network drive. Is there any way to have this same sort of environment for VFP or will I have to build an install module for each workstation?
>
>Thanks to all
>
>...........Rich

Rich,
I haven't done any converted screens but all rewrote (I was more coming from FPDOS not win maybe for that reason). At least that comes to mind is in VFP there is no more read cyle,read valid. Converted screens have Read and Read Modal properties that doesn't exist in forms done in VFP. Behavior is not same AFAIK and if you have any questions about your form's behavior you should include windowtype setting. For example in Fox2x a read blocks code from going to next line and form(s) (screen(s)) is displayed till it's deactivated. In VFP similar but not exactly same is read events (you'll soon become very familiar). Forms doesn't wait to be deactivated to continue code execution. I think you're getting confused (I'm confused myself writing:)

As I remember 'gotchas' was almost all about understanding OOP. I don't know if you're asking howto go from fox2x to VFP or just gotchas in conversion. Anyway at least would help someone else if the latter only.

What's a method,event was something I was confused at first. Simply assume method, event, procedure and function all as same thing (not I know - I don't want to direct you in the wrong way, trying to summarize in an unofficial way:).
Procedure and Function differ in name. Both get parameters and return values.
Methods are synonyms to procedures (not a keyword, if a procedure belongs to an object named method). IOW when you say method you know that it's a procedure belonging to an object.
ie: Eval() method. That's not evaluate() function. Eval method is a procedure of the Application object. There isn't a clear() function but there is a clear method (listbox, combobox objects).
myListBox.Clear or myListBox.Clear().
Difference between methods and events are that event code runs w/o and explicit call when the event occurs (ie: Click event code would run when object is clicked even though you don't explicitly call it to execute - you might in cases). In fox2x there were events too like valid,when...

In Fox2x we simply had screen objects identified by a memory variable names. ie: @ 1,2 say 'First Name:' get m.FirstName size ... [font ... color ... when ... valid ...]

Now instead you'd have a Textbox object named 'txtFirstName'. Name, font*,back/forecolor are properties of that object and when, valid are events. Where does m.FirstName (or alias.fieldname) go? Nowhere:) Forget getting 'value' back in a memory variable. Textbox object has a ControlSource property. For memory variables you'd simply do not touch it at all (leave at default (none)). For fields you'd set it to alias.fieldname. If you don't touch it and there is no m.FirstName how would you get/set the input 'value' then? Textbox has 'value' property:)
*Set
Textbox.Value = 'NewName'
*Get
myLocalVar = Textbox.Value

But wait it's Textbox object but how would VFP know you're referring to one that's getting FirstName and not LastName or something else. Name property holds the name to reference it:
txtFirstName.Value = 'NewName'

For a fox2x style this seems to be sufficient but not in VFP. txtFirstName might exist in multiple container objects (a form, a container in a form, a textbox in a column of a grid of a form...). Like files in folders you should fully qualify which one you mean. If the form's name is myForm:
myForm.txtFirstName.Value works (well it works really but not the way to go as it's easy to write code showing it doesn't work:)
Special Thisform identifier comes to the rescue. From any nethod/event/property in that form you can refer to it as:
thisform.txtFirstName.Value

OK I think enough on that part (would be funny if you're saying I already knew these:)

Parameters are still have scopes as it did in Fox2x but really confusing at first as if they're behaving different. ie: in fox2x if you've a varaible declared at top before screens it's visible to all screens. Actually just like that in VFP too. But in VFP there is more to it. If you for example say:

myVar = 3 && Assume declared here for the first time with or w/o some identifier except public
thisform.DoSomeMethod()

You shouldn't expect that method to know what myVar is. MyVar is not in scope of that method. To preserve variables between method calls you'd use most commonly form properties as they're visible to all form members.

Oh like wrting the getting started book:) Enough for now. Apologizes if you meant only the conversion.

For ESL, it's absolutely not a silly question, every developer thought about it I bet. In fox.wikis.com (don't know the exact page) there is a list of needed files per version. With VFP6 however Tools\Wizards\Setup wizard is the best IMHO (and I miss it since VFP6 - it was easy).
Either you copy needed files or use setup wizard do installation per station (performance reason just like in Fox2x). Keep only data in a central location.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform