Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need advice in design
Message
 
 
To
21/03/2000 00:41:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00348171
Message ID:
00348377
Views:
24
Vlad,

Thanks a lot for this advice. I'll try. One additional question: how can I determine the end of function?

These are my thoughts (haven't tried yet):
 local lcString, lnFirst, lnSecond, lnLen
 lcString=filetostr('myprocedurefile.prg') && Here could be a problem, I'm afraid, if the file is really big
** Do you know about limitations?
 lnFirst=atc('Function MyFunctionName', lcString)
 lnLen=len('Function MyFunctionName')+100 && to be sure
 lnSecond=atc('Function',substr(lcString,lnFirst+lnLen))
 modi comm MyprocedureFile range lnFirst, lnSecond
>You can use the RANGE clause of the MODIFY FILE/COMMAND. Like in:
>
>MODI COMM MyFuncs RANGE 2500, 2500
>
>If the start and end positions are the same, no text is selected and the cursor is positioned at the specified location.
>
>So, first open the file programatically, look for "FUNCTION TheFunctionIWant" (using atc()) and then open the file with
>MODI COMM. It should take no time to write a small prg for this task and assign it to a hot key.
>
>Vlad
>
>>I have this problem:
>>In our database we have 2 calculated fields: MapRef and APN. These fields are calculated using different algorithms for each town, e.g it could be town specific, but it also could be the same procedure for several different towns. Right now all algorithms reside in the big procedure file. We want to have table like this:
>>TownName MapRefProcedure APNProcedure.
>>
>>Now there is a problem. If we keep all functions in one big procedure file and for each town just reference a FunctionName in MapRefProcedure field, how can we edit the code for this particular function? I mean, we should be able to hit Edit button and go directly to the Function for this specific town. Is it possible?
>>
>>Another idea is to use a memo field with the actual code for each town and compile this code on the fly. In this case, obviously, we may have banch of other problems.
>>
>>I prefer the first idea, but how can I go directly to the specific function in a long procedure file?
>>
>>Hopefully, I explained my problem well.
>>
>>Any help would be greatly appreciated.
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform