Thanks beckadam! The storage methods I previously had only really focused on the current note, but now I am designing the storage methods for the entire program (not just the editor anymore). The code looks great, I’ll have to see if I can use it and what I can do with it soon.
» Forum
> Your Projects
Michael2_3B wrote:
Thanks beckadam! The storage methods I previously had only really focused on the current note, but now I am designing the storage methods for the entire program (not just the editor anymore). The code looks great, I’ll have to see if I can use it and what I can do with it soon.
So you could use a number of list "blocks" to have more space for files, and a separate list for each file's index in the list blocks, which would only be created when used! (is that what you mean by storage for the whole program?)
beckadamtheinventor wrote:
Michael2_3B wrote:
Thanks beckadam! The storage methods I previously had only really focused on the current note, but now I am designing the storage methods for the entire program (not just the editor anymore). The code looks great, I’ll have to see if I can use it and what I can do with it soon.
So you could use a number of list "blocks" to have more space for files, and a separate list for each file's index in the list blocks, which would only be created when used! (is that what you mean by storage for the whole program?)
Yeah, that’s basically what I mean. Here is my current storage for things:
Quote:
Str9 - available tokens
Str8 - token pixel widths (an alphanumeric string)
Str7 - the note being edited
Str6 - all notes, with delimiters to separate notes
- A list for the current note, contains character count and row width in pixels for each row.
- A list for all notes, contains data from previous list I mentioned with delimiter values inside.
I am happy to announce that I have gotten a lot done in the past week, and will be starting beta testing soon. (I know TLM volunteered earlier ) I actually have a summer class for the month of May which will need my attention more than this project, but I promise I have even more exciting stuff coming soon regarding this project.
Cursor Alignment
I have added the vertical alignment line like I said I would; if you don't know what I'm talking about, this is basically an invisible line that is created whenever you move the cursor left or right or modify the text. When moving the cursor up and down, the cursor sticks to the invisible line as close as possible. You can see this in a lot of text editors, even the text box I am writing in now.
Rendering
I have also improved the text rendering code, more so in that it is more pleasing to the eye. This means the lines of text renders from bottom to top when scrolling down and rendering from top to bottom when scrolling up. In terms of speed, I still have quite a bit of optimizing to do.
Subprogram
There is now one big subprogram that contains text rendering code and other tidbits of code that can be accessed by calling the subprogram with a specific value in Ans. I'm still working on it, but it should decrease the size of the main program significantly and I will have minimum duplicate pieces of code in the main program.
Storage
Note titles are defined as the first line of the note. If there is no text written in a note, the program will delete that instance and act as if the note never existed.
Notes can now be stored in one primary note string with no hassle. The associated list of values for the note is also stored in one primary list. Both of these variable types have delimiter values inside to separate one note from another. Honestly I'm pretty proud of the list storage here. Because of the fact that a note's associated list can become bigger or smaller (with the amount of lines in the note), the primary list also has to be changed in size and this requires shifting other values forward or backward. Obviously the more values to be shifted, the slower it is, but it still works great in terms of functionality--
Code:
And that's just a fraction of all the code in the project... anyways, I will release more code later, once I have fixed more problems and optimized the code.
There is a lot more than meets the eye...
This project is quite huge really, and there is a lot more than meets the eye and I can't really explain every little detail. Sure, the program has quite a few problems to fix still, but it is really becoming more beautiful, robust, powerful and practical every day - for a TI-Basic program, that is. Don't take my word for it, though; let me know what you all think If you want to be a beta tester, PM me and I will consider your request.
Cursor Alignment
I have added the vertical alignment line like I said I would; if you don't know what I'm talking about, this is basically an invisible line that is created whenever you move the cursor left or right or modify the text. When moving the cursor up and down, the cursor sticks to the invisible line as close as possible. You can see this in a lot of text editors, even the text box I am writing in now.
Rendering
I have also improved the text rendering code, more so in that it is more pleasing to the eye. This means the lines of text renders from bottom to top when scrolling down and rendering from top to bottom when scrolling up. In terms of speed, I still have quite a bit of optimizing to do.
Subprogram
There is now one big subprogram that contains text rendering code and other tidbits of code that can be accessed by calling the subprogram with a specific value in Ans. I'm still working on it, but it should decrease the size of the main program significantly and I will have minimum duplicate pieces of code in the main program.
Storage
Note titles are defined as the first line of the note. If there is no text written in a note, the program will delete that instance and act as if the note never existed.
Notes can now be stored in one primary note string with no hassle. The associated list of values for the note is also stored in one primary list. Both of these variable types have delimiter values inside to separate one note from another. Honestly I'm pretty proud of the list storage here. Because of the fact that a note's associated list can become bigger or smaller (with the amount of lines in the note), the primary list also has to be changed in size and this requires shifting other values forward or backward. Obviously the more values to be shifted, the slower it is, but it still works great in terms of functionality--
Code:
If O!=dim(|L1 //if the list size from before editing does not match the list size after editing
Then
If O<dim(|L1 //if the list size is bigger than before
Then
dim(|L1)-O+dim(|LBNOTE->dim(|LBNOTE //change size of main list
For(I,dim(|LBNOTE),R+dim(|L1),~1 //iterate from the end of the main list to the index of the end of the list being added
|LBNOTE(I-(dim(|L1)-O))->|LBNOTE(I
0->|LBNOTE(I-(dim(|L1)-O
End
End
If O>dim(|L1 //if the list size is smaller than before
Then
//will create smaller main list
End
End
And that's just a fraction of all the code in the project... anyways, I will release more code later, once I have fixed more problems and optimized the code.
There is a lot more than meets the eye...
This project is quite huge really, and there is a lot more than meets the eye and I can't really explain every little detail. Sure, the program has quite a few problems to fix still, but it is really becoming more beautiful, robust, powerful and practical every day - for a TI-Basic program, that is. Don't take my word for it, though; let me know what you all think If you want to be a beta tester, PM me and I will consider your request.
Wow, that's quite the update!
Yup, and I volunteer again!
A possible optimization suggestion, you have 'dim(|L1' a lot in your code, would it be faster to store the result into a variable then compare that rather than getting the size of the list every time? I would assume a variable would definitely be faster the longer the list is.
MichaelB wrote:
I know TLM volunteered earlier
Yup, and I volunteer again!
A possible optimization suggestion, you have 'dim(|L1' a lot in your code, would it be faster to store the result into a variable then compare that rather than getting the size of the list every time? I would assume a variable would definitely be faster the longer the list is.
This looks really shiny! I want to volunteer as well, looking for bugs or optimizing code. Keep up the great work!
-
Michael2_3B
- Official Cemetech Fruit Manager (Posts: 1369)
- 17 May 2018 07:26:29 pm
- Last edited by Michael2_3B on 18 Mar 2019 12:25:09 am; edited 4 times in total
The current subprogram is up for optimization, if you can understand it (I did some minor commenting)
https://github.com/Michael2-3B/BasicNoteCE/blob/master/src/ZNOTECE.txt
Among other things I've fixed, I've now added the following:
I am also thinking of making [clear] clear a line of text, as well as adding things like undo/redo, cut/copy/paste to the options menu. I haven't actually started thinking about how I'll make these, but if I do make them, should they be under the options menu or should I have specific key bindings for them?
To-Do:
-[clear] to clear a line of text
-options menu features (undo/redo/cut/copy/paste)
-highlighting/selecting text
-possible corruption detection?
-Find text feature
-more optimization!!
-and a bunch more nitpicky internal stuff
https://github.com/Michael2-3B/BasicNoteCE/blob/master/src/ZNOTECE.txt
Among other things I've fixed, I've now added the following:
- Scroll Bar
- Added options tab, but no features to it yet
- Note Deletion
- Manual Save Feature
- Added exit button
I am also thinking of making [clear] clear a line of text, as well as adding things like undo/redo, cut/copy/paste to the options menu. I haven't actually started thinking about how I'll make these, but if I do make them, should they be under the options menu or should I have specific key bindings for them?
To-Do:
-[clear] to clear a line of text
-options menu features (undo/redo/cut/copy/paste)
-highlighting/selecting text
-possible corruption detection?
-Find text feature
-more optimization!!
-and a bunch more nitpicky internal stuff
Here is an idea. Instead of [Clear] clearing a line of text, you could make it like the Del key on windows. Or you could make Del like the PC version and make [Clear] the backspace.
Would you ever implement changing the color of the text? That's be cool, but I don't know how hard it'd be. Would highlighting even be possible? (Other than the yellow on gray thing).
jcgter777 wrote:
Would you ever implement changing the color of the text? That's be cool, but I don't know how hard it'd be. Would highlighting even be possible? (Other than the yellow on gray thing).
I have thought about adding colored text, but I have decided against it, in favor of simplicity. Colored text would necessitate other hidden characters in the string which would complicate and slow down rendering even more. Am I saying it's too difficult? Mayb- I mean of course not. It's just simpler without it.
As for highlighting, what do you mean "the yellow on gray thing"? Also as you can see in my post, text selection is now possible (which can then be used for cut/copy/paste). But if you're referring to actual, permanent highlights like you would mark in a book, then no, I'm afraid that's not possible in TI-Basic since the OS's Text( command erases whatever is behind the text.
When you make text color white, it becomes yellow on gray, IIRC, but I don't really remember
I like the text selection thing! It's really cool. You should make it the "highlight", but maybe in a different color like blue. Great work so far!
I see why colored text isn't a great idea, but if you ever feel like adding stuff to this after you've finished, try the color!
I like the text selection thing! It's really cool. You should make it the "highlight", but maybe in a different color like blue. Great work so far!
I see why colored text isn't a great idea, but if you ever feel like adding stuff to this after you've finished, try the color!
-
Michael2_3B
- Official Cemetech Fruit Manager (Posts: 1369)
- 20 May 2018 05:04:45 pm
- Last edited by Michael2_3B on 18 Mar 2019 12:25:23 am; edited 1 time in total
Selection works better now, but there are definitely optimizations to be had. Here's a simple example of copying and pasting:
-
Michael2_3B
- Official Cemetech Fruit Manager (Posts: 1369)
- 23 May 2018 02:01:05 am
- Last edited by Michael2_3B on 18 Mar 2019 12:25:35 am; edited 2 times in total
Minor update-
Added a special characters menu! Accessed through [2nd]+catalog. Can (fairly) easily add other special characters if need be.
*casually ignores the more crucial internal issues*
Added a special characters menu! Accessed through [2nd]+catalog. Can (fairly) easily add other special characters if need be.
*casually ignores the more crucial internal issues*
Caleb_J wrote:
Hey Michael!
I really like how this project is coming along; great work so far! Keep it up.
I really like how this project is coming along; great work so far! Keep it up.
Thanks, Caleb!
Here's the update of the week-
The program is pretty feature-full already, and there are only about 1 or 2 features still to be implemented.
One such feature would be a "find text" feature, both within the current note and for searching all notes from the menu screen.
Another feature might be corruption detection at the start of the program which could possibly auto-fix (or have a manual fix feature) in the event that note data has been tampered with or misaligned, or otherwise would cause an error if there was no detection.
String-to-list compression may or may not become a reality within the program, but I will need to look further into it after I fix other things, since it seems it may be necessary or else other programs will overwrite the strings.
Other than that, I am attempting to fix/redo some code involving boring, but critical (and difficult), internal issues. The project is really not too far from completion, once I get these issues solved and do some optimization! It's likely a first public release will be seen in June!
Technical Issue #1 of several-
You can now insert a line break anywhere in the note, instead of only at the end of the note. This is an important issue because now words will properly shift in response to the new line break, so that everything is properly displayed!
You can now insert a line break anywhere in the note, instead of only at the end of the note. This is an important issue because now words will properly shift in response to the new line break, so that everything is properly displayed!
-
Michael2_3B
- Official Cemetech Fruit Manager (Posts: 1369)
- 06 Jun 2018 10:22:34 pm
- Last edited by Michael2_3B on 18 Mar 2019 12:25:46 am; edited 1 time in total
Okay, I lied in the last post. NOW, line break insertion should work 100%!!
You can see this at work in a short line of text and a whole paragraph in the following screenie:
Of course, the bigger the paragraph the longer the processing time. I'll be working on optimizing that
You can see this at work in a short line of text and a whole paragraph in the following screenie:
Of course, the bigger the paragraph the longer the processing time. I'll be working on optimizing that
Technical Issue #2 of only a couple more (that I know of) now,
You can now hit the delete key to backspace anywhere in the note. This also re-calculates word-wrappings if and when necessary.
You can now hit the delete key to backspace anywhere in the note. This also re-calculates word-wrappings if and when necessary.
-
Michael2_3B
- Official Cemetech Fruit Manager (Posts: 1369)
- almost there
- 21 Jun 2018 04:29:38 pm
- Last edited by Michael2_3B on 21 Jun 2018 11:25:57 pm; edited 2 times in total
If you saw my last post, I deleted it because word-wrapping is still a thing! I just have to rework how it handles it a bit.
The program is coming along nicely, I just need to tie up a few loose ends and optimize the whole thing.
To-Do:
I am also working on another routine which will take a string and convert it into BasicNote note format, in other words it creates a list that tells how many characters on each line and the line pixel width. This will especially help in pasting and other calculations, if I can get it to work.
I have also written the README, so I'm getting close
EDIT: Success! I have completed the routine which converts a string to a note. Assume that the string is Str7 and it always starts with a non-showing space character. Words will be word-wrapped if they extend beyond the border of 262. "[xbar]" signifies a line break. Here is the code:
Code:
This can be used for calculations when pasting, also find&replace if I add that, and possibly .txt to Note if I ever do that (no promises).
Also, pasting now works 100%!
The program is coming along nicely, I just need to tie up a few loose ends and optimize the whole thing.
To-Do:
- Fix delete key function (works, but not 100%)
- Fix character insertion (works, but not 100%)
- Optimize, try to allow faster keypresses so less character entries are missed
I am also working on another routine which will take a string and convert it into BasicNote note format, in other words it creates a list that tells how many characters on each line and the line pixel width. This will especially help in pasting and other calculations, if I can get it to work.
I have also written the README, so I'm getting close
EDIT: Success! I have completed the routine which converts a string to a note. Assume that the string is Str7 and it always starts with a non-showing space character. Words will be word-wrapped if they extend beyond the border of 262. "[xbar]" signifies a line break. Here is the code:
Code:
DelVar GDelVar JDelVar L
1->R
{Ans->L1
{0->L2
For(X,2,length(Str7
If sub(Str7,X,1,)="[xbar]"
Then
augment(L1,{X->L1
1+dim(L2->dim(L2
DelVar JDelVar LDelVar GR+1->R
Else
inString("123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgh",sub(Str9,inString(Str8,sub(Str7,X,1)),1->W
G+Ans->G
If sub(Str7,P,1)=" "
Then
P->J
G->L
End
If G>262
Then
R+1->dim(L1
Ans->dim(L2
If J
Then
J->L1(R
L->L2(R
R+1->R
P->L1(Ans
G-L->L2(R
Ans->G
Else
P-1->L1(R
G-W->L2(R
R+1->R
P->L1(Ans
W->L2(R
Ans->G
End
Else
G->L2(R
P->L1(R
End
End
End
For(I,1,dim(L1
L1(I)+L2(I)/|E3->L1(I
End
This can be used for calculations when pasting, also find&replace if I add that, and possibly .txt to Note if I ever do that (no promises).
Also, pasting now works 100%!
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
» Goto page Previous 1, 2, 3, 4, 5 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 2 of 5
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement