To start, I know it has been done (considering DocDE started in BASIC), I just became bored during English class the other day and decided to work on this. Anyway, could someone tell me if there is a way I could make this smaller?


Code:

ClrDraw
Horizontal 31
Vertical 47
Vertical ú47
Line(39,23,39,31
Horizontal 23

DelVar áNO
1üdim(áNO
9üA:2üB:1üC
Text(1,2,"Document DE BASIC
Lbl 1
Text(1,89,"A
If B>93:Then
2üB:A+6üA:End

0üÁ
getKey

If Ans=31:Then
Goto 2:End
If Ans=23:Then
B-4üB:C-1üC
If B<2 and A=9
Then
B+4üB:C+1üC
Goto 1:End
If B<2:Then
A-6üA:90üB
End
Text(A,B,"    ":0üáNO(C:End

If Ans=102:Then
0üáNO(C:1üÁ
End

If Ans=45:Then
ClrDraw
ClrHome
Output(1,1,""
Stop:End

If Ans=41:Then
Text(A,B,"A
1üáNO(C:1üÁ
End
If Ans=42:Then
Text(A,B,"B
2üáNO(C:1üÁ
End
If Ans=43:Then
Text(A,B,"C
3üáNO(C:1üÁ
End
If Ans=51:Then
Text(A,B,"D
4üáNO(C:1üÁ
End
If Ans=52:Then
Text(A,B,"E
5üáNO(C:1üÁ
End
If Ans=53:Then
Text(A,B,"F
6üáNO(C:1üÁ
End
If Ans=54:Then
Text(A,B,"G
7üáNO(C:1üÁ
End
If Ans=55:Then
Text(A,B,"H
8üáNO(C:1üÁ
End
If Ans=61:Then
Text(A,B,"I
9üáNO(C:1üÁ
End
If Ans=62:Then
Text(A,B,"J
10üáNO(C:1üÁ
End
If Ans=63:Then
Text(A,B,"K
11üáNO(C:1üÁ
End
If Ans=64:Then
Text(A,B,"L
12üáNO(C:1üÁ
End
If Ans=65:Then
Text(A,B,"M
13üáNO(C:1üÁ
End
If Ans=71:Then
Text(A,B,"N
14üáNO(C:1üÁ
End
If Ans=72:Then
Text(A,B,"O
15üáNO(C:1üÁ
End
If Ans=73:Then
Text(A,B,"P
16üáNO(C:1üÁ
End
If Ans=74:Then
Text(A,B,"Q
17üáNO(C:1üÁ
End
If Ans=75:Then
Text(A,B,"R
18üáNO(C:1üÁ
End
If Ans=81:Then
Text(A,B,"S
19üáNO(C:1üÁ
End
If Ans=82:Then
Text(A,B,"T
20üáNO(C:1üÁ
End
If Ans=83:Then
Text(A,B,"U
21üáNO(C:1üÁ
End
If Ans=84:Then
Text(A,B,"V
22üáNO(C:1üÁ
End
If Ans=85:Then
Text(A,B,"W
23üáNO(C:1üÁ
End
If Ans=91:Then
Text(A,B,"X
24üáNO(C:1üÁ
End
If Ans=92:Then
Text(A,B,"Y
25üáNO(C:1üÁ
End
If Ans=93:Then
Text(A,B,"Z
26üáNO(C:1üÁ
End



If Á=1:Then
B+4üB:C+1üC
End
Goto 1


1. Sorry about the long code. (It is still long after I cut it in half, so yes there is more.)
2. And as you know the u with the dots is a -> symobl and the A with the ' is a colon (Smile.
3. Thank you to anyone who helps.
If your IF statement only has 1 consequence, the THEN and END statements are not required.

eg.

If K=45
Then
Goto Q
End

Not only causes memory leak but could also be:

If K=45
Goto Q

Edit: And yes, that could be optimized an ungodly ammount with the use of strings, sadly, I am string-illiterate.
Your right, I will fix that, and yes I am terrible with strings too.
Get strings. Strings are easy once you master the sub() command, which allows you to read portions of strings...
You should probably change the name, as Kerm is officially moving DocDE to ASM (just like you need to get permission from Kerm to use his code - if you are using his code)
Nope that is 100% my code and I was planning to change the name.
Kllrnohj wrote:
You should probably change the name, as Kerm is officially moving DocDE to ASM (just like you need to get permission from Kerm to use his code - if you are using his code)
Not only is, but has. I just submitted the final 6.0 to ticalc.org.
this is insane learn strings and then come back, no offense or any thing but you could optimize this so much with instring and sub( master them and then I'll take a look.
Anyways, I have officially changed the name to NotepadExpress (yes I know, it's cheezy) and I know how to use the sub() command perfectly well, thankyou Mr. Storm. Mad Very Happy

If you want to see the BETA version of my program please download it here.
Sorry but the way you wrote the code above mad you look uber noobish when it comes to strings and IF statements because using sub and instring for that would be so much easyier. :p
my sugestion would be to make each line a Sting or untill it is 999 charicters long and then convert it into a list and when they save you combine the lists and separate them with a specail number like -1. That way when you convert it back to a string you would start a new line at -1.
Mexi1010 wrote:
To start, I know it has been done (considering DocDE started in BASIC), I just became bored during English class the other day and decided to work on this. Anyway, could someone tell me if there is a way I could make this smaller?


Code:

ClrDraw
Horizontal 31
Vertical 47
Vertical ú47
Line(39,23,39,31
Horizontal 23

DelVar áNO
1üdim(áNO
9üA:2üB:1üC
Text(1,2,"Document DE BASIC
Lbl 1
Text(1,89,"A
If B>93:Then
2üB:A+6üA:End

0üÁ
getKey

If Ans=31:Then
Goto 2:End
If Ans=23:Then
B-4üB:C-1üC
If B<2 and A=9
Then
B+4üB:C+1üC
Goto 1:End
If B<2:Then
A-6üA:90üB
End
Text(A,B,"    ":0üáNO(C:End

If Ans=102:Then
0üáNO(C:1üÁ
End

If Ans=45:Then
ClrDraw
ClrHome
Output(1,1,""
Stop:End

If Ans=41:Then
Text(A,B,"A
1üáNO(C:1üÁ
End
If Ans=42:Then
Text(A,B,"B
2üáNO(C:1üÁ
End
If Ans=43:Then
Text(A,B,"C
3üáNO(C:1üÁ
End
If Ans=51:Then
Text(A,B,"D
4üáNO(C:1üÁ
End
If Ans=52:Then
Text(A,B,"E
5üáNO(C:1üÁ
End
If Ans=53:Then
Text(A,B,"F
6üáNO(C:1üÁ
End
If Ans=54:Then
Text(A,B,"G
7üáNO(C:1üÁ
End
If Ans=55:Then
Text(A,B,"H
8üáNO(C:1üÁ
End
If Ans=61:Then
Text(A,B,"I
9üáNO(C:1üÁ
End
If Ans=62:Then
Text(A,B,"J
10üáNO(C:1üÁ
End
If Ans=63:Then
Text(A,B,"K
11üáNO(C:1üÁ
End
If Ans=64:Then
Text(A,B,"L
12üáNO(C:1üÁ
End
If Ans=65:Then
Text(A,B,"M
13üáNO(C:1üÁ
End
If Ans=71:Then
Text(A,B,"N
14üáNO(C:1üÁ
End
If Ans=72:Then
Text(A,B,"O
15üáNO(C:1üÁ
End
If Ans=73:Then
Text(A,B,"P
16üáNO(C:1üÁ
End
If Ans=74:Then
Text(A,B,"Q
17üáNO(C:1üÁ
End
If Ans=75:Then
Text(A,B,"R
18üáNO(C:1üÁ
End
If Ans=81:Then
Text(A,B,"S
19üáNO(C:1üÁ
End
If Ans=82:Then
Text(A,B,"T
20üáNO(C:1üÁ
End
If Ans=83:Then
Text(A,B,"U
21üáNO(C:1üÁ
End
If Ans=84:Then
Text(A,B,"V
22üáNO(C:1üÁ
End
If Ans=85:Then
Text(A,B,"W
23üáNO(C:1üÁ
End
If Ans=91:Then
Text(A,B,"X
24üáNO(C:1üÁ
End
If Ans=92:Then
Text(A,B,"Y
25üáNO(C:1üÁ
End
If Ans=93:Then
Text(A,B,"Z
26üáNO(C:1üÁ
End



If Á=1:Then
B+4üB:C+1üC
End
Goto 1


1. Sorry about the long code. (It is still long after I cut it in half, so yes there is more.)
2. And as you know the u with the dots is a -> symobl and the A with the ' is a colon (Smile.
3. Thank you to anyone who helps.


Ah, my eyes!!! http://www.ticalc.org/archives/files/fileinfo/363/36335.html

There are two programs, one for the homescreen, the other for the graphscreen.. They write text to the screen, and are tiny in comparison with what you have there... both of them just under 400 bytes each...
tifreak8x wrote:
Ah, my eyes!!! http://www.ticalc.org/archives/files/fileinfo/363/36335.html

There are two programs, one for the homescreen, the other for the graphscreen.. They write text to the screen, and are tiny in comparison with what you have there... both of them just under 400 bytes each...

Agreed! Razz Take a look at those and then try to optimize them if you want.
  
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
Page 1 of 1
» 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

 

Advertisement