CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: alexgt on November 12, 2015, 03:24:30 AM

Title: SynText - A Program, Note, and App editor for the HP Prime [HP Prime][HP PPL]
Post by: alexgt on November 12, 2015, 03:24:30 AM
SynText is a IDE for your HP Prime (I think) it is the first for the Prime :)
Features:
- None (started on the project less than an hour ago)

Planned features:
- Sick IDE with Syntax highlighting, color scheme, and touch responsive!!!
-  Awesome note editor
- Also it will be able to edit all of the current app's vars and functions inside the editor
Major progress tomorrow (hyped to get my Prime back ^.^)
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on November 12, 2015, 07:57:54 AM
The main problem with the standard program editor is slow scrolling speed. I wonder how easy it would be to just scan through the code that is visible in the screen? Also maybe make it so it scrolls character by character.

Anyway I am curious about what you will come up with. Syntax highlighting should probably be kept last during development in case speed becomes a serious problem.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime [HP Prime][HP PPL]
Post by: Strontium on November 12, 2015, 08:05:59 AM
How do you plan on doing the syntax highlighting? The first thing I can come up with is RegEx but I dont think the Prime supports those.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 12, 2015, 05:22:37 PM
Quote from: DJ Omnimaga on November 12, 2015, 07:57:54 AM
The main problem with the standard program editor is slow scrolling speed. I wonder how easy it would be to just scan through the code that is visible in the screen? Also maybe make it so it scrolls character by character.

Anyway I am curious about what you will come up with. Syntax highlighting should probably be kept last during development in case speed becomes a serious problem.
Yeah most of the stuff like that I will implement in the latter stages of development, right now I want a good IDE on calc so I can resume MinePrime ;)

Quote from: Strontium on November 12, 2015, 08:05:59 AM
How do you plan on doing the syntax highlighting? The first thing I can come up with is RegEx but I dont think the Prime supports those.
There is a command: INSTRING(String1,String2) that looks for String2 in String1 so when I am outputting the text to the screen I could use:

IFPos:=INSTRING(Code,"IF");
IF IFPos !=0 THEN
//make this text blue
END;

What that would do is look in the var Code for the string "IF" and then return it's position, I would use some fancy stuff to go word by word through each line displaying highlighted stuff (which really shouldn't take that big of a hit to the speed)

The way I am loading the program to be ready to edit is putting each line into a list and then having an {x,y} var for the cursor so I will be able to tell what row the cursor is in and also what character it is on, then I will piece it back together  and store it into the program's source.

Hope it made sense ;)
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: novenary on November 12, 2015, 05:27:35 PM
So line by line coloring ?
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 12, 2015, 05:28:58 PM
Yeah but the text size will be a bit larger than normal so it won't be as hard to code/use the touch screen so it won't be that bad :)
Title: Re: SynText - A Program, Note, and App editor for the HP Prime [HP Prime][HP PPL]
Post by: alexgt on November 12, 2015, 09:42:54 PM
UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE
Added v0.01
- Takes own source code and separates it line by line then stores it into LineList
that is all to edit what program it separates edit SynText and follow the instructions in the first function ;)

It is not on Github because it wan't working for me <_<
Title: Re: SynText - A Program, Note, and App editor for the HP Prime [HP Prime][HP PPL]
Post by: alexgt on November 13, 2015, 05:57:15 PM
Ok, I just realized how stupid I was in posting the above post (I never put a download there xD)

/me slams head into desk

So here it is...xD
Title: Re: SynText - A Program, Note, and App editor for the HP Prime [HP Prime][HP PPL]
Post by: p4nix on November 13, 2015, 05:59:13 PM
No one noticed yet - you could have edited :P Did you had problems with uploading to github, or don't you want to upload? Good luck for new features in new updates!
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 13, 2015, 06:12:55 PM
I was using source tree (not that I am experienced with it i have only made 2 repositories) but it wasn't working,
I made a new repository and set the folder it got the files from,
then I put the file I wanted commit into the folder.
After that I pressed commit, and added the comment "v0.01"
I pressed commit and it did it, I did something to set up a remote named origin so I could puch it but then I got an error.

I think I did something wrong <_<
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 14, 2015, 11:50:39 PM
Ok, there is a bug that has been squashed with the latest version so no worries but no further progress will be made till monday (mom took my calc away <_< only for the weekend tho ;))

Bug: Stopped separating program into parts at first new blank line of code
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on November 15, 2015, 06:10:26 AM
Have you gotten any luck getting line break detection to work? I recall you had some troubles figuring out which character it was a few months ago.

Also I hope your parents won't ever do this (https://www.cemetech.net/forum/viewtopic.php?p=241122#241122) O.O
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: novenary on November 15, 2015, 09:31:54 AM
Quote from: DJ Omnimaga on November 15, 2015, 06:10:26 AM
Also I hope your parents won't ever do this (https://www.cemetech.net/forum/viewtopic.php?p=241122#241122) O.O
Almost happened to my computers a couple times. <_< There's been physical damage but nothing major thankfully (save for the imac glass which cost 150 euros to replace ._.).
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 15, 2015, 05:10:03 PM
Quote from: DJ Omnimaga on November 15, 2015, 06:10:26 AM
Have you gotten any luck getting line break detection to work? I recall you had some troubles figuring out which character it was a few months ago.

Also I hope your parents won't ever do this (https://www.cemetech.net/forum/viewtopic.php?p=241122#241122) O.O
Yes, I did find out how to do that, instead of putting a special character that took the place of a new line I just made a new line in the actual source like this:

INSTRING(ProgStr,"
"); //Returns the first occurrence of a new line in the string ProgStr

So the only difference from the actual character is that the code looks messy <_<

And wow, my parents never would do that to my calc but my dad got really mad once and threatened to break my computer O.O
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on November 16, 2015, 09:59:57 PM
Ouch Streetwalrus x.x. ALso Alexgt does it mean that code edited with your editor will look messy in the HP Prime editor and vice-versa? I'm missing something I think.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 16, 2015, 11:23:11 PM
No stuff edited with SynText will look great in the built in prog editor and visa versa. So if you make a new line in SynText it will also make a new line in the prog editor so no one long line in the regular editor of all your source if you are wondering.

I store all the lines into a list like this:
{line1,line2,line3,...lineN}
each of the lines end with a new line (even though you cannot see it).

when the user is done using the editor and hits save it uses this code

ProgStr:="" //Stores empty string into ProgStr making the var into a string
//Line Count is amount of lines in the program

FOR A FROM 1 TO LineCount DO
   ProgStr:=ProgStr + LineList(A) //LineList is the list with all the lines in the program each element containing its own line.
END;

That takes the list with all the lines of source and knits them back together forming the edited program. What you see in SynText you will see exactly the same stuff in the   regular editor. This I already have implemented and now I need to make the menu where you choose the program to edit and to add the editor then it will be useable ;)
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 18, 2015, 01:13:18 AM
New Update!!!
Added:
- TouchScreen menu!!!
- Esc to makes program into a list of all source lines

Bugs Fixed
- Stopped defragmentation at first new line

Bugs Created:
- To work you need at least 15+ programs already on your calc (working on this one :P)

Next Update:
- Fully functional menu able to show all programs
- Maybe some more :P

DOWNLOAD IN FIRST POST (v0.06)
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on November 18, 2015, 01:17:01 AM
Cool, I'll give it a try when I get some chance. By the way, does it have loading bars like in MinePrime when opening programs if it takes a while? Sometimes I open large programs in the default editor and since it doesn't show progress I always think my calc froze.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 18, 2015, 01:26:18 AM
Yeah, I will add that but right now I am putting together the bare necessities so-to-speak which I now have. Next step is completing the menu and adding the editor then it will be useable ;). Then I start on MinePrime (again <_<) making it allot neater, readable, commented, and optimized! While I am starting on MinePrime progress will slow on SynText and possibly I will start on a on calc pixel art program so I can edit sprites on the go. That is the plan but you know how plans go <_<
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on November 19, 2015, 10:46:22 PM
I wonder how hard it would be to implement a search function?
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 20, 2015, 03:51:23 AM
I have been keeping that in the back of my mind and I don't think it would be that difficult actually, depending on how far the word is from the start it could take a while for bigger programs <_<
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on November 20, 2015, 06:17:01 AM
YEah I figured so. It would probably still be useful, though.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on November 20, 2015, 02:03:59 PM
If you are searching a program that is 30kb then it will take like 3 seconds so not that bad
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on November 21, 2015, 08:30:25 AM
Interesting, I would have thought it was faster considering it seemed fast on the FX-9860G. But again, Casio programs are token-based, so perhaps that's why?
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on December 09, 2015, 07:28:46 PM
Well to has to to go through every line and in a 30kb program ant that would ~ be 800 + lines if it was all in the constraints of the screen. And I have to go through every line searching for the key words.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on December 11, 2015, 08:24:05 AM
I'm thinking it has something to do with code not being tokenized. On the HP Prime, TEXTOUT() is 9 characters, while on the TI-84+, Text( is just 1 character and the closing parentheses can be omitted.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on December 11, 2015, 08:36:10 PM
That would only help with syntax highlighting the way I am doing it. But it would not help with saving since I would still have to go down the list and put all the strings together.
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: Dream of Omnimaga on December 12, 2015, 10:11:24 AM
That sounds quite complicated. Either way, good luck with this project and I really need to give the latest version a try when I have extra free time. :)
Title: Re: SynText - A Program, Note, and App editor for the HP Prime
Post by: alexgt on December 13, 2015, 07:21:21 AM
Nah you don' have to it is really only a glithed out versions that crashes because of a bug I fixed a while back. Once I can display some text I will release a worth-while one ;)