Ivar B. Jessen
2004-01-02 16:11:35 UTC
The dBASE editor component is very slow when loading a file larger than around
20-40 Kb, but it is also slow when it has to move from one line to another
using form.editor1.lineNo.
Save the code below and run.
When the form opens I see a short flash of the file opened and displayed with
correct line lengths, then the editor displays the file as a single wrapped
line where the line breaks have been replaced by htlm-tags for paragraphs, all
this lasts about 27 seconds. After that the editor again displays the file
correctly but it takes about another 27 seconds before the cursor reappears.
Now grab the thumb of the vertical scrollbar and move it up and down. Note
that the lines displayed in the editor moves correspondingly without any delay
giving the impression that the editor.value has now been reformatted correctly
and is now sitting in memory ready to be displayed at a moments notice.
When I press the button 'Go to bottom' the editor moves quickly to the bottom
line, ie 'at a moments notice', but again it takes about 27 seconds before the
cursor reappears.
In the on_click event of the button, editor1.lineNo is set to 1426. If that is
changed to 2 it will also take 27 seconds to move from line 1 to line 2!
Ivar B. Jessen
//-----
//----- demoSearch.wfm ------
** END HEADER -- do not remove this line
//
// Generated on 02-01-2004
//
parameter bModal
local f
f = new demoSearchForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class demoSearchForm of FORM
with (this)
onOpen = class::FORM_ONOPEN
scroll = class::SCROLL
height = 15.3636
left = 7.7143
top = 2.1364
width = 91.0
text = ""
endwith
this.EDITOR1 = new EDITOR(this)
with (this.EDITOR1)
height = 13.0
left = 1.0
top = 0.5
width = 89.0
value = ""
marginHorizontal = 5.0
endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_ONCLICK
height = 1.0909
left = 1.0
top = 14.0
width = 15.2857
text = "Go to bottom"
endwith
this.PUSHBUTTON2 = new PUSHBUTTON(this)
with (this.PUSHBUTTON2)
onClick = class::PUSHBUTTON2_ONCLICK
height = 1.0909
left = 19.0
top = 14.0
width = 15.2857
text = "Go to top"
endwith
this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
height = 1.0
left = 36.0
top = 14.0
width = 54.0
text = ""
endwith
function form_onOpen
cFile = _dbwinhome + "Samples\Contax\Scheduler.wfm"
f = new file()
f.open(cFile, "R")
cStr = f.read(f.size(cfile))
re = new oleautoclient("VBScript.RegExp")
re.ignoreCase = true
re.Global = true
re.pattern = "endclass"
re.execute(cStr)
form.editor1.evalTags = false
form.editor1.value = re.replace(cStr, "<b><u>$&</u></b>")
form.editor1.evalTags = true
return
function PUSHBUTTON1_onClick
class::scroll(1426)
return
function PUSHBUTTON2_onClick
class::scroll(1)
return
function scroll(gt)
form.textlabel1.text = ""
st = new date().getTime()
form.editor1.lineNo = gt
form.editor1.setfocus()
et = new date().getTime()
form.textlabel1.text = int((et - st)/1000)+ ;
" seconds for focus to return to editor!"
return
endclass
//----- EOF demoSearch.wfm -----
//-----
20-40 Kb, but it is also slow when it has to move from one line to another
using form.editor1.lineNo.
Save the code below and run.
When the form opens I see a short flash of the file opened and displayed with
correct line lengths, then the editor displays the file as a single wrapped
line where the line breaks have been replaced by htlm-tags for paragraphs, all
this lasts about 27 seconds. After that the editor again displays the file
correctly but it takes about another 27 seconds before the cursor reappears.
Now grab the thumb of the vertical scrollbar and move it up and down. Note
that the lines displayed in the editor moves correspondingly without any delay
giving the impression that the editor.value has now been reformatted correctly
and is now sitting in memory ready to be displayed at a moments notice.
When I press the button 'Go to bottom' the editor moves quickly to the bottom
line, ie 'at a moments notice', but again it takes about 27 seconds before the
cursor reappears.
In the on_click event of the button, editor1.lineNo is set to 1426. If that is
changed to 2 it will also take 27 seconds to move from line 1 to line 2!
Ivar B. Jessen
//-----
//----- demoSearch.wfm ------
** END HEADER -- do not remove this line
//
// Generated on 02-01-2004
//
parameter bModal
local f
f = new demoSearchForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif
class demoSearchForm of FORM
with (this)
onOpen = class::FORM_ONOPEN
scroll = class::SCROLL
height = 15.3636
left = 7.7143
top = 2.1364
width = 91.0
text = ""
endwith
this.EDITOR1 = new EDITOR(this)
with (this.EDITOR1)
height = 13.0
left = 1.0
top = 0.5
width = 89.0
value = ""
marginHorizontal = 5.0
endwith
this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_ONCLICK
height = 1.0909
left = 1.0
top = 14.0
width = 15.2857
text = "Go to bottom"
endwith
this.PUSHBUTTON2 = new PUSHBUTTON(this)
with (this.PUSHBUTTON2)
onClick = class::PUSHBUTTON2_ONCLICK
height = 1.0909
left = 19.0
top = 14.0
width = 15.2857
text = "Go to top"
endwith
this.TEXTLABEL1 = new TEXTLABEL(this)
with (this.TEXTLABEL1)
height = 1.0
left = 36.0
top = 14.0
width = 54.0
text = ""
endwith
function form_onOpen
cFile = _dbwinhome + "Samples\Contax\Scheduler.wfm"
f = new file()
f.open(cFile, "R")
cStr = f.read(f.size(cfile))
re = new oleautoclient("VBScript.RegExp")
re.ignoreCase = true
re.Global = true
re.pattern = "endclass"
re.execute(cStr)
form.editor1.evalTags = false
form.editor1.value = re.replace(cStr, "<b><u>$&</u></b>")
form.editor1.evalTags = true
return
function PUSHBUTTON1_onClick
class::scroll(1426)
return
function PUSHBUTTON2_onClick
class::scroll(1)
return
function scroll(gt)
form.textlabel1.text = ""
st = new date().getTime()
form.editor1.lineNo = gt
form.editor1.setfocus()
et = new date().getTime()
form.textlabel1.text = int((et - st)/1000)+ ;
" seconds for focus to return to editor!"
return
endclass
//----- EOF demoSearch.wfm -----
//-----