Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
+-----------------+
| BasicNote |
+-----------------+

I started this project on the 11th. It's turning out to be a bigger project than I expected it to be, so I'm making a thread about it. Note, this project is nowhere near done, but I got a lot of the menu stuff out of the way so far. Anyways, before I start talking about it, heres a screenshot Smile

CONTROLS: Arrow keys to move cursor, ENTER to select, CLEAR to quit program at any time.

As you can see, the menu is pretty much the only thing done. Because I haven't started programming some other things yet, I have some dummies currently in there:
--"THIS NOTE 0x5" will be replaced with the titles of the notes.
--By clicking on one of the notes, the Y-Coord of your cursor pops up, and the program ends. Later, clicking on it will make you enter editing mode.

Also as you can see, the program stops running after all the different options (however, clicking cancel is currently programmed to return to the main menu). Later, they will all be programmed to return back to the menu or whatever, without stopping the program.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
The text input/editing will be on the graph screen, and will most likely use TIBD's Custom Text Input Routine, along with possible modifications by me.

To-Do List:
Notes:
(Done) creating new notes
(Mostly Done)note editing (obviously)
(Done) Text highlighting, deleting, inserting
(Done) Right click options (copy, paste, cut, maybe some others)

Menu:
Deleting individual notes
More sidebar options if necessary
(Done) the title of each note will load, depending on a list element

Also, the way I currently have it set up limits the amount of different notes to 6, as there are only 6 slots on the screen. I may add scrolling, however I will still be limited to 10 strings. If anyone really wants me too, I can program it so only one string needs to be used, which will allow for many notes to be stored, only limited by the amount of RAM. But seriously, who needs that many notes on a calculator? Just put it all in one note...
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
::IMPORTANT:: Program is not being created for unethical reasons. I am not responsible if you use this for the wrong reason.
Does this use strings? Otherwise, looks cool!
Unicorn wrote:
Does this use strings? Otherwise, looks cool!

Yes, strings are used to store the notes. As I said in the post:
Michael2_3B wrote:
the way I currently have it set up limits the amount of different notes to 6, as there are only 6 slots on the screen. I may add scrolling, however I will still be limited to 10 strings. If anyone really wants me too, I can program it so only one string needs to be used, which will allow for many notes to be stored, only limited by the amount of RAM.
I really want you to remove strings, could you do that? I think its possible
Unicorn wrote:
I really want you to remove strings, could you do that? I think its possible

Why? Strings would be the easiest and most efficient way to do this. Even if I did remove strings, how would I do it then?
Yeah, keep the strings. There's no other way that I know of storing text in a variable.
You could save it in lists. You could easily get 2 characters per list entry with int( and fPart(. I think the theoretical max amount of characters you could store per list entry would be 7-9 before you start losing precision (and thus losing data) assuming 1 byte per character
Unknownloner wrote:
You could save it in lists. You could easily get 2 characters per list entry with int( and fPart(. I think the theoretical max amount of characters you could store per list entry would be 7-9 before you start losing precision (and thus losing data) assuming 1 byte per character

Yes, I know I could save numbers in lists that correspond to the letter, but still, that is fairly inefficient and would take up more RAM. I am going to keep the strings as the way to store notes, for now.

Also, why do you say 7-9 characters per list entry? Could you elaborate?
Floats are 9 bytes large in memory. The maximum byte usage, which is practically the same as strings then, is 9 bytes. However, because you can make your own text structures, you can try to use ascii and have the text be only half a byte, thus allowing for 18 letters per list element. This should be simple to make but it's not as easy.
Of course, there is always text compression, which good ones could manage 1 bit per letter. But really, just go with strings, much simpler.
Okay, I currently have it setup to use 6 different strings(which may change in the future, depending on how many people want to be able to create more than 6 notes). To load the title of each string, the list element corresponding to that string must have a value of 1. In the future, I will probably make it a value of 2 if the string is archived, which will tell it not to display the string(because you can't display things while they are in the archive). Anyways, when you create the string (which I haven't coded yet), the value of 1 will be stored into the corresponding list element. That way, when you load the program, it will know if a string exists or not.

So currently, to load the title of each string, here's my code:

Code:

"/TIBN.TITLE=
If |LTIBN(1
Text(12,36,sub(Str1,inString(Str1,Ans)+12,inString(Str1,"/END.TITLE/")-(inString(Str1,Ans)+12
If |LTIBN(2
Text(20,36,sub(Str2,inString(Str2,Ans)+12,inString(Str2,"/END.TITLE/")-(inString(Str2,Ans)+12
If |LTIBN(3
Text(28,36,sub(Str3,inString(Str3,Ans)+12,inString(Str3,"/END.TITLE/")-(inString(Str3,Ans)+12
If |LTIBN(4
Text(36,36,sub(Str4,inString(Str4,Ans)+12,inString(Str4,"/END.TITLE/")-(inString(Str4,Ans)+12
If |LTIBN(5
Text(44,36,sub(Str5,inString(Str5,Ans)+12,inString(Str5,"/END.TITLE/")-(inString(Str5,Ans)+12
If |LTIBN(6
Text(52,36,sub(Str6,inString(Str6,Ans)+12,inString(Str6,"/END.TITLE/")-(inString(Str6,Ans)+12

Can anyone optimize this? I know it's a lot of repetition, but since you can't do Str(variable), it makes it a bit harder.

Also, there's just one problem I've found with this code: if the user inputs "/END.TITLE" as the title of their note, it makes the program crash on startup. I'll probably just fix it by making a loop on the title input that repeats until the users input is not anything that can make the startup crash.

EDIT: Also, I will probably limit title size to 11 characters, but I was also thinking of making the end of the title "..." if the title is too long to display. Even if I do that, I will limit the title size so it can actually fit on the entire screen (from left border to right border) while in text-editing mode.

EDIT 2: I was also thinking about not even having a title - instead, the first line of notes that the user writes will be displayed on the menu. What do you guys think?
For the crashing problem, try using an untypeable character or token for the delimiter. I like to use the Stats Plots symbols, which are available at the end of the catalog.
Michael, I don't want you to use strings because it might interfere with other programs. But, that is for the author to decide. Razz
It's looking pretty spiffy right now!
Unicorn wrote:
Michael, I don't want you to use strings because it might interfere with other programs. But, that is for the author to decide. Razz
It's looking pretty spiffy right now!

Yeah sorry, I'm going to keep the strings for now just for simplicity. After I release the final program, I may decide to release an update that uses a different form of storage for the notes, but we will see Smile

EDIT: Instead of archiving/unarchiving notes, I originally wanted to add a function where you can group the strings so that you can save them and still have other programs use strings without deleting your notes. Unfortunately, I don't believe there is a way to group things from within a program in pure BASIC Sad
KermMartian wrote:
For the crashing problem, try using an untypeable character or token for the delimiter. I like to use the Stats Plots symbols, which are available at the end of the catalog.

Thanks for the suggestion! I will definitely use it Smile
There would be a way to group the strings together, but there wouldn't be a way to archive them individually. What you could try is placing all the strings together into a single one, and have the delimiter separating each one. That way, you would only take up a single string for all the notes to take up. It would be just a long string of the notes, but you could edit it with the program still and view them individually.
Also, this would remove the limit of 10 notes total, as you can use as many as you want because everything is on one string.

Code:
"THIS IS A NOTE�NOT A NOTE"->Str0
inString(Str0,"�",1)-1->A
Disp sub(Str0,1,A)
inString(Str0,"�",A+2)-2->B
Disp sub(Str0,A+2,B-A)
Yeah, that's pretty much what I have for the startup too. It only displays the title text, but it sorts out the raw text used for determining where titles and strings are. I think I'll add that for all the notes. Here's what the string will probably look like:

Code:

"�TITLE1=**USER INPUTTED TEXT**�NOTE1=**USER INPUTTED TEXT**�TITLE2=**USER INPUTTED TEXT**�NOTE2=(etc. etc.)

Also, I could archive them individually, but this would only work if i was using multiple strings.

Code:

If A=12:Archive Str1
If A=20:Archive Str2
If A=28:Archive Str3
etc.

I think I'll go with 1 string though, but unfortunately, as you said, it won't be possible to archive the individual notes Sad
Seems pretty awesome. I was planning on doing this using Kerm's DCS BASICLibs, but you've beaten me to it, and done a much better job.
Also, if I were to use 1 string, my previous code can be optimized:

Code:

For(I,1,6
If |LTIBN(I
Text(4(2I+1),36,**a bunch of sub and inString() stuff**
End

I will also probably add a scrolling feature of some sort. The previous code is only for startup. When scrolling, a similar code will probably be used.
May I recommend trying to use the Celtic libraries to offer named files stored in Archiveable AppVars? That would solve the problem of stepping on Str variables or potentially having files be overwritten by other programs that use strings.
KermMartian wrote:
May I recommend trying to use the Celtic libraries to offer named files stored in Archiveable AppVars? That would solve the problem of stepping on Str variables or potentially having files be overwritten by other programs that use strings.

Seems like a cool idea, maybe if you could explain how to do so I might do it, but most likely not, as I am trying to keep everything basic. However, if anyone wants to, you can modify my program later so that it uses Celtic libraries.

Also, if everything goes the way I think it will, the program will only use 1 string to store all the notes. If you want to make sure it doesn't get deleted, you can archive it from within the program, however this won't stop you from deleting it outside the program (either manually or by a mem/RAM clear). Also, other programs won't be able to change or delete that String, unless they unarchive that string first.

EDIT: Because the text editing/inputting will be on the graph screen, more than 1 string will need to be used, but there will still only be one string to store the notes. One string will be for storing all the notes, one will be for the vocabulary ("ABCD...WXYZ ?!.^*+-/()[]{}" and probably some more symbols), and maybe 1 other string for the actual editing (don't know yet).
  
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
» Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
» View previous topic :: View next topic  
Page 1 of 9
» All times are GMT - 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

 

Advertisement