Convert Manual

Post Reply
User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Convert Manual

Post by rbytes »

With each update, this program lets you create a compact index of SPL. If you move it to the folder where you are designing a program, the ManualOut.txt file can give you a quick format check of any function. Or copy the compact index and paste it right into the program you are building. Be sure to comment it out before you test run your program! The instructions are in the comments at the head of the program.

Code: Select all

''
Convert Manual by rbytes
September 2017
Instructions:
1. Navigate to the SPL Help Index page
2. Copy the entire page
3. Create a file in this program’s
path called "manual.txt"
4. Paste the text into it
5. Change the text in the temp variable
   (line 4 of code) to the correct SPL version.
7. Run this program.
6. Keep the "ManualOut" file handy as you design
   programs. It is a compact index.
7. You can quickly check the format of a function.
8. With practice, you can copy functions from it 
   faster than you can type them, especially 
   if you paste the compact index into
   your program while you are building it.
9. Update the compact index with each new version of SPL.
''
f1="Manual.txt"
f2="ManualOut.txt"
? #.fexist(f2), #.fdelete(f2)
temp="SPL Manual V23"
temp2=""
q = ["#.cr","#.crlf","#.e","#.lf","#.pi","#.quot","#.rs","#.tab"]
r = #.size(q,1)
#.output(r)
#.writetext(f2,temp+#.lf)
temp=""
> ! #.fend(f1)
temp=#.readline(f1)

? #.size(temp) > 2
  skip = 0
  > t,1..r
    ? q[t] = temp, skip = 1    
  <
  ? skip
    temp2 += temp + " "
  !
    temp2 += temp + "() "
  .
  
! 
  ? #.size(temp) = 1
    #.writetext(f2,temp2+#.lf)
    #.writetext(f2,temp+": ")
    
    
    temp2 = ""
  ! 
    #.writetext(f2,temp+#.lf)
  .
.
< 
#.writetext(f2,temp2+#.lf)
#.fontsize(40)
#.drawtext(550,200,"Done!")
#.end()
Attachments
Screenshot (91).png
Screenshot (91).png (172.38 KiB) Viewed 3660 times
Last edited by rbytes on Sun Oct 01, 2017 3:07 pm, edited 1 time in total.
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Convert Manual

Post by Mr. Kibernetik »

Very interesting.

I see that clipboard functions are needed.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Convert Manual

Post by rbytes »

Yes, that would be nice.

I am just making some changes to my programs using the new file commands. Great addition to SPL!

I am also working on a converter that will translate Smart Basic code to SPL. It will take me a few days to get all the data entered, but the code routines are mostly worked out.
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Convert Manual

Post by Mr. Kibernetik »

rbytes wrote:
Sat Sep 30, 2017 9:38 pm
I am also working on a converter that will translate Smart Basic code to SPL. It will take me a few days to get all the data entered, but the code routines are mostly worked out.
This sounds fantastic :!:

But there are some general differences. For example, SPL array index always starts from 1 and in BASIC it can be 0.

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Convert Manual

Post by rbytes »

Yes, it is easy when the function doesn’t take parameters inside the parentheses. It is just a swap of one command for another. I have two arrays, one with Smart Basic functions and the other with matching SPL functions. But I need to create special cases for things like #.drawcolor(r,g,b), in which the second parenthesis has to surround the given values for r,g,b. I’m thinking of a third array with flags of various values, that will trigger the special cases.

Currently the program passes single comment lines unprocessed. It corrects multiline comments. By Sunday it will also ignore the comment portion of a code line.

The way I consider it, if the Smart Basic code still requires a few changes after the auto-translation to run in SPL, but my converter removes 95% of the work, it will be worthwhile and encourage new participants to port their stuff.
The only thing that gets me down is gravity...

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Convert Manual

Post by Mr. Kibernetik »

I wish you good luck with this very difficult task!

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Convert Manual

Post by rbytes »

8-)
The only thing that gets me down is gravity...

Post Reply