Sum Macro Suggestions

62 views
Skip to first unread message

Jose Adriano Baltieri

unread,
Dec 30, 2024, 11:47:11 AM12/30/24
to sem...@googlegroups.com
Hi !

Just some minor suggestions for Sum.s macro :
  1. Be able to copy the sum, either decimal or hexadecimal, either to ClipBoard (internal) or Windows ClipBoard...
  2. Add Quick Keys (&) to all of the options..
Very easy to do, I guess...

Maybe someone else could implement...

--


Grato,
Jose Adriano Baltieri

Jose Adriano Baltieri

unread,
Dec 31, 2024, 5:03:43 AM12/31/24
to SemWare TSE Pro text editor
One more suggestion, that I forgot to mention :

3. "Decimal Point is Comma" option : some countries have "," as decimal separator and "." as thousand separator.  1.234,54 would be one thousand, 234 bucks and 54 cents. 

knud van eeden

unread,
Jan 1, 2025, 7:15:09 AM1/1/25
to SemWare TSE Pro text editor, S.E. Mitchell
> Just some minor suggestions for Sum.s macro 
Be able to copy the sum, either decimal or hexadecimal, either to ClipBoard (internal) or Windows ClipBoard..
> Add Quick Keys (&) to all of the options.

1. See attached sum.s

2. I have created an quick implementation of this feature request.

3. The feature request with comma option I am not going to look into for now, probably easiest and best stick to the current notation.

a. There are probably too much variations thinkable, only complicating.

b. Showing many more examples of what you see now against what you would like to see
would help further.

Something like this:

c. One workaround might maybe be to do where applicable an afterwards local global search replace ('giln') in the sum block,
e.g. as usual 
1. replace dot by some temporary character
2. then replace comma by dot
3. then replace temporary character by comma
one could add this as a option in the menu where applicable, to be applied at the end in Main()

d. Or replace only the comma in the last 3 characters or something like that and add that as a menu option called at the end in Main()

e. Or using StrReplace() to convert the sum result in the wanted result and add that as a menu option called at the end in Main().

with friendly greetings
Knud van Eeden




--

---
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/3874b9a0-a74a-4b26-80a2-0856b1c212e0n%40googlegroups.com
.
sum.s

Jose Adriano Baltieri

unread,
Jan 1, 2025, 7:55:04 AM1/1/25
to sem...@googlegroups.com
Thank U so much !

I've rearranged menu items, slightly more organized, I think...

As for the "DECIMAL POINT IS COMMA" issue, I've put some DEFINEs at the top. So it's easier for one to configure it as it's installed  inside Tessie... IOW, adapt it to your country, compile it and you're ready to go !

Thanks again and a very happy 2025 4 U all !

SUM.S

knud van eeden

unread,
Jan 1, 2025, 8:09:24 AM1/1/25
to sem...@googlegroups.com, S.E. Mitchell
1. Yes, that latest SUM.S has a better order in the menu options.

2. Small change by me in that SUM.S file: 
I changed the menu '&' (because of a duplicate '&' occurrence in '&Microsoft &Windows')

3. See latest changed attached SUM.S with that little change implemented.
SUM.S

Jose Adriano Baltieri

unread,
Jan 1, 2025, 8:18:20 AM1/1/25
to sem...@googlegroups.com
Sorry, I did yet some other arrangements here... It looks more organized and practical, like image below.

Also reviewed the code to be adapted to the DEFINEs (DECIMAL POINT IS COMMA)...
 

image.png

Thanks again !

--

---
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.
SUM.S

knud van eeden

unread,
Jan 1, 2025, 8:37:00 AM1/1/25
to sem...@googlegroups.com, S.E. Mitchell
OK, that last version looks good and handles additionally a possible '.' and ',' usage
(the default is/should be the old default assignment as before).

If Semware agrees, then this latest SUM.S could e.g. replace the current sum.s in the TSE 'mac' subdirectory.
SUM.S

zhong zhao

unread,
Jan 1, 2025, 9:38:39 PM1/1/25
to SemWare TSE Pro text editor
Welcome to try Powerful zzcalc!
(^_^)
Calculate the value of a function expression given by >=1 command-line parameter.
Support (),+,-,*,x,/,%,^^,^&,^|,^@,Pi,sin,cos,tan,sqrt,arcsin,arccos,arctan,lg,ln,exp,ceil,floor,round,sign,abs,d2r,r2d,k,m,g,t,p,K,M,G,T,P
The last parameter is .0-.15 ,the result should be rounded to 0-15 decimal places
The last parameter is g1-g15 ,the result retain significant figures 1-15
The last parameter is e0-e15 ,the result are expressed by Scientific notation, and 0-15 digits are reserved after the decimal point
The last parameter is x      ,the result in hexadecimal positive integer format
The last parameter is x_     ,the result is output as a hexadecimal positive integer with a 2-bit interval format
The last parameter is b      ,the result is output as a binary positive integer in the format of intervals every 4 bits
The last parameter is o      ,the result is output as a positive integer in base 8 and every 4 bits in the _ interval format
The last parameter is :      ,the result is formatted to DDD HH:MM:SS.mss
Support : Interval HH:MM:SS.mss format input
Hexadecimal integers start with 0x or 0X, binary integers start with 0b or 0B, and hexadecimal integers start with 0o or 0O, and can contain underscore intervals
Support 64 bit binary arithmetic left shift { and right shift } operators
Support 64 bit binary specified partial bit segment binary shift functionshift{l|a|r}{l|r}{ss}{ee|lnn}{sh}
    {l|a|r} Logic|Arithmetic|Rotate Logic|Arithmetic|Rotate
    {l|r}   Left|Right              LeftShift|RightShift
    {ss}    start_bit               StartBit(0-63)
    {ee}    end_bit                 EndBit(StartBit-63)
    {nn}    n_bits                  BitWidth(02-64)
    {sh}    shift_bits              ShiftCount(01-BitWidth)
    Ex: 'shiftar010503(0b101111) b', move the binary number 101111 right by bit01 to bit05 three times, and the result is:
        0b0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0011_1101
Ignore commas in expressions (usually used as thousandths separators)
The first parameter is a comma, the integer part of the result is separated by commas every 3 digits
The first parameter is an underline, the integer part of the result is underlined every 4 bits
The first parameter is /home/username/data.txt, sum every line in file /home/username/data.txt, or difference of the first line HH:MM:SS.mss and the last line HH:MM:SS.mss of file /home/username/data.txt
The first parameter is /f and /home/username/tse/log/zzcalcresult.txt is writable, redirect all outputs to this file

Usage:
in tse/
g++ zzcalc.cpp -o zzcalc
sudo chmod 777 zzcalc
in tse/mac/
sc32 zzcalc.s
in tse/ui/tse.ui, insert
<Alt =>                 ExecMacro("zzcalc")
then <Ctrl F9> in e
zzcalc.cpp
zzcalc.s

knud van eeden

unread,
Jan 2, 2025, 9:45:17 AM1/2/25
to SemWare TSE Pro text editor
> Zhong Zhao wrote:
> zzcalc

Thanks.

1. That is thus a C++ Linux version.

2. As used in zzcalc.s:

Note first that 'CopyToWinClip()' does *not* work in Linux as far as I know, it is used in your zzcalc.s thus.
But 'CopyToWinClip()' of course works in Microsoft Windows.

3. But I mainly / only work in general in Microsoft Windows.

4. So I have changed 

    zzcalc.s 

     to instead

    zzcalcwindowsbcc.s

and removed the '/home/username/... prefixes,
so removing dependency on Linux filenames and filepaths
and this works in Microsoft Windows also of course.

Now only using the filename itself thus. 

That is more general as it means the file is expected to be in the *current directory*, whatever that directory is.

5. I also replaced (with the help of 'Claude' AI) your 

      zzcalc.cpp from a Linux only version

to a Microsoft Windows version (compiled successfully with
Borland C++ version 5.5. command line compiler (=bcc)).

  zzcalcwindowsbcc.cpp

6. See attachment, containing:

1. zzcalcwindowsbcc.s

2. zzcalcwindowsbcc.cpp

7. If necessary if you can not compile the .cpp yourself on Microsoft Windows you can download the successfully compiled executable here:


(note: in the Google Chrome browser you will have to accept the download in the right top in the download icon (=keep))

8. Question: As you know the details and how it works, could you please further debug and upload that 
changed working zzcalcwindowsbcc.s (and working OK in TSE for Windows).

At the moment zzcalcwindowsbcc.s  does not do much, it is basically your original zzcalc.s, only with the filepath changed thus
and it does not work as far as I can tell.

Thanks
zzcalcwindowsbcc.cpp
zzcalcwindowsbcc.s

knud van eeden

unread,
Jan 2, 2025, 1:14:08 PM1/2/25
to SemWare TSE Pro text editor

Here also a .cpp version that compiles on Microsoft Windows with Cygwin gcc.

1. Automatically converted from the Borland C++ command line compiler version 5.5 (see the previous .cpp attached) version to a Cygwin gcc version using DeepSeek AI

https://chat.deepseek.com/
(this is currently free to use)

2. Note: FYI: In this automatic source code generation regard 

    DeepSeek 

is superior to other AIs 
(like ChatGPT, Claude, Gemini, Perplexity, not tried yet Grok)
because DeepSeek has a 'Continue' button at the bottom of its generated source code 
and clicking it keeps continuing generation of the source code in the same window, until the end of the generated source code is reached.

3. All other AIs stop generating at about 8K tokens output, you have to type manually 'continue' to let it continue and that typically breaks a longer program
in pieces which sometimes breaks the program and or you would need debugging and or manually inserting that partial code at the correct location in the full program and so on. Much more complicated and sometimes not really doable if a complex program.

4. Seemingly DeepSeek does not have that limit or at least a much larger limit.

5. Compile the attached .cpp program on a Microsoft Windows computer as follows:

a. On my computer goto the Cygwin bin directory:

    gcc.exe zzcalcwindowsgcc.cpp -o zzcalcwindowsgcc

b. In case one has mingw installed

    mingw32-g++.exe zzcalcwindowsgcc.cpp -o zzcalcwindowsgcc
zzcalcwindowsgcc.cpp

Rick Hodgin

unread,
Jan 2, 2025, 1:19:30 PM1/2/25
to sem...@googlegroups.com

There's a bignums dll out there somewhere that presents a logical spreadsheet, and does most of those functions in a spreadsheet form.  It also has arbitrary data precision so it can be highly accurate.

Doesn't have a Linux version, but one could be created.

--
Rick C. Hodgin


--

---
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.

knud van eeden

unread,
Jan 2, 2025, 1:29:58 PM1/2/25
to sem...@googlegroups.com
On Thursday, January 2, 2025 at 07:19:38 PM GMT+1, Rick Hodgin wrote:
> There's a bignums dll out there somewhere that presents a logical spreadsheet, and does most of those functions in a spreadsheet form.  It also has arbitrary data precision so it can be highly > accurate.
> Doesn't have a Linux version, but one could be created.

1. Yes, I know, I have been looking into your 2 programs again the last days:

1. DLL:

a. With the spreadsheet DLL

b. With the DLL with C++ mathematical functions (sin, cos, tan, ...)

That is thus the 'dll' approach.

---

2. External executable (this is quite simple, because using Dos() one can pass the parameters to the command line)

This zzcalc.s approach is thus some external executable program to which one passes the mathematical expressions e.g. as parameters.

Note; There seems also an option to input the mathematical expression via a block and or file, but I must see or get it working first.

---

3. External executable (even simpler because this is like a black box, ready made already)

I used a similar approach using BBCBASIC for Windows, which is an interpreter. Built in it it has an 'eval' function (with built in sin, cos, tan, ...)
One can create an executable .exe of this eval function. 
Then similar via the command line passing mathematical expressions to it via Dos().

zhong zhao

unread,
Jan 2, 2025, 8:43:26 PM1/2/25
to SemWare TSE Pro text editor
Thank you for the work done by knud van eeden.

Actually, it was originally the Windows version. I specifically modified this Linux version to adapt to Linux and pure English environments
https://blog.csdn.net/zhao4zhong1/article/details/140720490

Eckhard Hillmann

unread,
Jan 3, 2025, 9:38:57 AM1/3/25
to sem...@googlegroups.com

FYI:


I wrote some macros and dll/exe files currently for personal use only to do my calculations and building sums.


- a calculator

- a sum builder

- a sum line builder

 

For further details what these macros and exe can do please see attached help and command-line 

files.

 

Because there are a lot of other macros, exe and dll's out there which do the same job,

I don't know if there really is a need for another one.

 

One small disadvantage, the macros are originally written for personal use only, all 

my comments are in german. If there is a need to translate them I can do this, but it 

will take some time. As mentioned before, only if there is really an interest in 

translating and uploading it.

 

Because of the necessary binary files, without them nothing would work, it is hard to 

post a zip containing them here. If there really is an interest in these macros and exe 

I will look for a way to make it available here. I would probably ask Sammy if he is 

willing to put it on his server for download.

 











-- 
Best regards
Eckhard                                    mailto:or...@ewetel.net



Ihre Nachricht vom Donnerstag, 2. Januar 2025 19:29:


kvevSTPte>  On Thursday, January 2, 2025 at 07:19:38 PM GMT+1, Rick Hodgin wrote: > There's a bignums dll out there somewhere that presents a logical spreadsheet, and does most of those functions in a spreadsheet form.  It also has arbitrary data precision so it can be highly > accurate.> Doesn't have a Linux version, but one could be created.
kvevSTPte> 1. Yes, I know, I have been looking into your 2 programs again the last days:
kvevSTPte> 1. DLL:
kvevSTPte> a. With the spreadsheet DLL
kvevSTPte> b. With the DLL with C++ mathematical functions (sin, cos, tan, ...)
kvevSTPte> That is thus the 'dll' approach.
kvevSTPte> ---
kvevSTPte> 2. External executable (this is quite simple, because using Dos() one can pass the parameters to the command line)
kvevSTPte> This zzcalc.s approach is thus some external executable program to which one passes the mathematical expressions e.g. as parameters.
kvevSTPte> Note; There seems also an option to input the mathematical expression via a block and or file, but I must see or get it working first.
kvevSTPte> ---
kvevSTPte> 3. External executable (even simpler because this is like a black box, ready made already)


kvevSTPte> I used a similar approach using BBCBASIC for Windows, which is an interpreter. Built in it it has an 'eval' function (with built in sin, cos, tan, ...)One can create an executable .exe of this eval function. Then similar via the command line passing mathematical expressions to it via Dos().


kvevSTPte> with friendly greetingsKnud van Eeden




kvevSTPte>   
FppHelp.txt
CmdLine.txt

Knud van Eeden

unread,
Jan 3, 2025, 10:22:34 AM1/3/25
to sem...@googlegroups.com

> One small disadvantage, the macros are originally written for personal use only, all 

my comments are in german. If there is a need to translate them I can do this, but it 

will take some time. As mentioned before, only if there is really an interest in 

translating and uploading it.


I assume at this moment that this can be done in a few minutes.


Just paste your file containing the German text in an AI like Claude, ChatGPT, Gemini, (maybe DeepSeek, not sure) and prompt it to convert the appropriate German text to English text.


with friendly greetings

Knud van Eeden



--

---
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.

Knud van Eeden

unread,
Jan 3, 2025, 10:27:09 AM1/3/25
to sem...@googlegroups.com

> Because of the necessary binary files, without them nothing would work, it is hard to 

post a zip containing them here. If there really is an interest in these macros and exe 

I will look for a way to make it available here. I would probably ask Sammy if he is 

willing to put it on his server for download.


I assume the following workaround should work:


1. First rename that .exe file(s) to another extension e.g. .txt

(that is important because even a zip with password on it will be rejected by most email providers due to the .exe extension as they can read and check the filename extension still)


2. Zip those file(s) but with a zip password.


3. Inform the user(s) that they have to rename the .txt to .exe


4. Inform the user(s) that they have to use a zip password (that you provide in that email also) to open that password protected zip file.


with friendly greetings

Knud van Eeden


On Fri, Jan 3, 2025 at 3:38 PM Eckhard Hillmann <or...@ewetel.net> wrote:
--

---
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.

knud van eeden

unread,
Jan 3, 2025, 10:37:33 AM1/3/25
to sem...@googlegroups.com
Another option might be that you upload (all) your files to e.g.

GitHub

or 

SourceForge

(free account)

and let the user(s) download it from there.

Reply all
Reply to author
Forward
0 new messages