Post by billbeasley on Dec 30, 2008 14:09:08 GMT -5
So I sez to myself...
Myself, why do you see some imperative code changes that just must be made when viewing the project file?
Why do you make an immediate change in the code, run it, it works as expected, then you save the now wonderfully perfect project file, knowing the changes are not reflected in the module code?
Why do you later reopen your project modules in the Workshop and go... "Duh, thought I fixed that."?
Obvious answer, Myself is getting too old to be writing code modules longer than about 10 lines, Myself shouldn't be participating in the young man's game of "mine is longer than yours" when evaluating program quality or there should be a tool in the already fantastic LB Workshop to reverse the project file back into the "include modules".
Pending any consideration of Ms. Alyce in providing such an "old guy" crutch, I've whipped together a quickie to do just that. Some of the hard coded stuff could be replaced with input/output prompts but as a suggestion it's okay.
Free example in the public domain:
Myself, why do you see some imperative code changes that just must be made when viewing the project file?
Why do you make an immediate change in the code, run it, it works as expected, then you save the now wonderfully perfect project file, knowing the changes are not reflected in the module code?
Why do you later reopen your project modules in the Workshop and go... "Duh, thought I fixed that."?
Obvious answer, Myself is getting too old to be writing code modules longer than about 10 lines, Myself shouldn't be participating in the young man's game of "mine is longer than yours" when evaluating program quality or there should be a tool in the already fantastic LB Workshop to reverse the project file back into the "include modules".
Pending any consideration of Ms. Alyce in providing such an "old guy" crutch, I've whipped together a quickie to do just that. Some of the hard coded stuff could be replaced with input/output prompts but as a suggestion it's okay.
Free example in the public domain:
dir$ = "N:\SimpleForm\"
projFileName$ = "sf.proj.bas"
mainProjModName$ = "sf.main.bas"
includeCount = 0
open dir$+projFileName$ for input as #projf
do
line input #projf, text$
if instr(lower$(text$),"include") then
includeCount = includeCount + 1
if includeCount = 1 then
ptrIncludes = loc(#projf)-len(text$)
end if
end if
loop until eof(#projf)
dim moduleName$(includeCount)
moduleName$(0) = mainProjModName$+".txt"
seek #projf, ptrIncludes
for i = 1 to includeCount
line input #projf, text$
moduleName$(i) = word$(text$,2)+".txt"
next i
seek #projf, 1
cnt = 0
open dir$+moduleName$(cnt) for output as #outf
do
line input #projf, text$
if instr(text$,"'*******************************") then
close #outf
cnt = cnt + 1
open dir$+moduleName$(cnt) for output as #outf
end if
print #outf, text$
loop until eof(#projf)
close #outf
close #projf
print "done"
end