FillBlock() support up to 128 characters

24 views
Skip to first unread message

zhong zhao

unread,
Jun 11, 2025, 4:31:09 AM6/11/25
to SemWare TSE Pro text editor
I filled a string with a length greater than 128 into a column block with a width greater than 128 using FillBlock(). As a result, the first 128 characters of the column block were filled correctly, but the characters from 129th onwards were filled with a string that repeats from the first character onwards, instead of the original string after the 129th character. I thought I could fill a string of no more than 255 characters in length.

Carlo Hogeveen

unread,
Jun 11, 2025, 4:52:50 AM6/11/25
to sem...@googlegroups.com

Hi Zhong Zhao,
I cannot reproduce your report with the test macro below.
For me it creates a line with 255 filled columns.
Carlo


proc Main()
integer c = 0
string s [255] = ''
for c = Asc('a') to Asc('z')
s = s + Format('':10:Chr(c))
endfor
NewFile()
AddLine()
MarkColumn(CurrLine(), 1, CurrLine(), 255)
FillBlock(s)
PurgeMacro(CurrMacroFilename())
end Main



zhong zhao

unread,
Jun 11, 2025, 10:22:14 PM6/11/25
to SemWare TSE Pro text editor
I use 
<ctrl k><l> FillBlock()
in tse.ui to bind hot key ctrl+k,L to FillBlock()
and I mark a string which length is 140, then copy to clipboard,
then mark a column block which width is 140,
then press ctrl+k,L
when prompt "Fill Block with:",I paste the string from clipboard,<Enter>
then get the result:
the column block column 1 to 128 are pasted correctly, but column 129 to 140 is not.

Carlo Hogeveen

unread,
Jun 12, 2025, 4:52:19 AM6/12/25
to sem...@googlegroups.com

Yes, I can reproduce that.
The root cause is that the FillBlock prompt cannot hold more than 128 characters.
Only Sammy can change that.

Until then:
Below I created 2 macros.

The first macro is named "fill_block".
In your .ui file you can replace FillBlock() with ExecMacro('fill_block'), and compile the .ui file.
It will repair your problem for now.
The fill_block macro does not have the extra keys that FillBlock's prompt's bottom line shows.
Let me know if you need those.

The second macro is a test macro that reproduces FillBlock's problem and shows that fill_block solves it.

Note, aside:
There is no need to replace the temporary key that the test macro uses.
The key only exists during the test macro's run-time and overrules any user key definitions.

Carlo



fill_block macro:
========================================
proc fill_block()
string s [255] = ''

if Ask('Fill block with:', s, _FILLBLOCK_HISTORY_)
FillBlock(s)
endif
end fill_block

proc Main()
fill_block()
PurgeMacro(CurrMacroFilename())
end Main
========================================



Test macro:
========================================
proc Main()
integer i = 0
string s [255] = ''
integer test_string_length = 140

for i = 5 to 255 by 5
s = s + Format(i:5:'.')
endfor
NewFile()
AddLine()
AddLine('Source line:')
AddLine(s)
MarkColumn(CurrLine(), 1, CurrLine(), test_string_length)
Copy()

AddLine()
AddLine('Line created with FillBlock():')
AddLine()
MarkColumn(CurrLine(), 1, CurrLine(), test_string_length)
PushKey(<Enter>)
PushKey(<Ctrl p>)
FillBlock()

AddLine()
AddLine("Line created with ExecMacro('fill_block'):")
AddLine()
MarkColumn(CurrLine(), 1, CurrLine(), test_string_length)
PushKey(<Enter>)
PushKey(<Ctrl p>)
ExecMacro('fill_block')
UnMarkBlock()
AddLine()
BegLine()

PurgeMacro(CurrMacroFilename())
end Main

<Ctrl p> Paste()
========================================



S.E. Mitchell

unread,
Jun 27, 2025, 9:21:41 PM6/27/25
to sem...@googlegroups.com
Sorry for the problem.
This will be fixed in the next update.
--
Sammy Mitchell
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/semware/1f590efa-4600-4332-b7a0-ac393cc38d7en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages