Anyway, that is my introduction. I will get straight to my question.
I am making an arbitrary precision calculator, but I am having a problem. It is as follows:
I have the user input numbers (via INKEY$), and it is directly put into a file names Num1.txt (and Num2.txt). Everything is good so far.
My algorithms require there to be leading zeros, and I need to know how to put on the leading zeros in the text file (prepending line number 1) AS WELL AS taking carry-overs over 40 digits, and putting them into the next line.
[The following is an example file]
Original File
Code: Select all
48923678924367043297309861037640398087423
58970276487136083468437614387647643471031
16767105757657647031658704670657765
What I need.
From above, to this:
Code: Select all
[000000000]48923678924367043297309861037640[398087423]
58970276487136083468437614387647643471031
16767105757657647031658704670657765
to
[000000000]48923678924367043297309861037640
[398087423]58970276487136083468437614387647[643471031]
16767105757657647031658704670657765
to
[000000000]48923678924367043297309861037640
[398087423]58970276487136083468437614387647
[643471031]16767105757657647031658704670657[765]
to
[000000000]48923678924367043297309861037640
[398087423]58970276487136083468437614387647
[643471031]16767105757657647031658704670657
[765]
Final Result (num1.txt):
Code: Select all
00000000048923678924367043297309861037640
39808742358970276487136083468437614387647
64347103116767105757657647031658704670657
765