Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comment By condition
Message
From
18/06/2009 10:54:13
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01406827
Message ID:
01406874
Views:
36
>>>>Hi
>>>>
>>>>I have long code that contain also 'scan..endscan'.
>>>>
>>>>The user can run the code with two options, one option is without this scan.
>>>>So, in that case can I ask VFP to cosider this two lines as comment or I have to copy all the code to other method (toremove the scan..) and to remember to update each change?
>>>>
>>>>Tnx
>>>
>>>The only way out would be to move the lines of code to run always into the separate function / method.
>>>
>>>I don't think you can get away with compilation time constant here.
>>
>>Imho, more consistent coding would be slight modifying in the scan, i.e. it could be called all times, but under certain conditions it would 'scan' one-record cursor while in other situations it would be 'complete' cursor.
>
>I see, you're saying we can add lcFor condition with '.T.' for all records and probably [myPKField = 'the pk value of the field to run'] for one record.

Not actually that. I meant that scan is likely for some cursor, so under certain conditions code may create one-record cursor and still scan it, i.e. both cases use the same code, number of records in the cursor is the only difference.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform