Post Reply 
newRPL: [UPDATED April 27-2017] Firmware for testing available for download
07-15-2016, 02:40 AM
Post: #325
RE: newRPL: [UPDATED July-14-16] Firmware for testing available for download
(07-14-2016 09:51 PM)Guenter Schink Wrote:  Is there a description of the SD commands, function/syntax, anywhere?


Not yet, but here's a quick briefing:
File names can be an IDENT or a string or a list with a path { HOME 'MYDIR' 'NAME' }. Strings can also have paths: "/MYDIR/NAME" is the same as the list before.
The SD Card can have a partition table (MBR) with up to 4 partitions. The syntax accepted is any of DOS syntax "C:/FILENAME", or HP50g syntax ":3:/FILENAME". Other partitions would be letter "D", "E" and "F", or :4:, :5: and :6:.
Files and directory names are case-sensitive (despite being a FAT filesystem), so you can store 'MyVar', 'MYVAR' as 2 separate files.
SDSTO/SDRCL ... same as STO/RCL, except the variable name can be an ident, string, or list as explained above.
SDSETPART ... Select the active partition, takes an integer 0-3.
SDCHDIR ... Change to directory name in level 1.
SDMKDIR ... Create new directory
SDPGDIR ... Delete an empty directory
SDPURGE ... Delete a file (I just realized I forgot this command, so it's not there yet!)
SDOPENxxx ... Open a file, leave a file handle (an integer in hex base) on the stack. The variants are xxx=RD (read only), WR (write), MOD (modify any byte within the file without truncating the existing data), APP (append at the end).
SDCLOSE ... Take a handle and close the file
SDREADTEXT ... nchars handle -> String with the text read from the file. nchars is the number of Unicode characters to read. handle is the handle returned by SDOPENxxx.
SDWRITETEXT ... string handle -> Write the string to the file.
SDREADLINE ... handle -> Read a line of text and return it as a string (includes the terminating newline).
SDSEEKxxx ... Move the current offset within a file (takes the offset and handle as arguments) to the given position. The position is relative to xxx=STA -> start of the file, xxx=END -> end of file, xxx=CUR -> current position.
SDTELL ... Take a handle and return the current offset from the start of file
SDFILESIZE ... Take a handle and return the file size.
SDEOF ... Take a handle and return TRUE (1) if the last operation reached the end of file.
SDOPENDIR ... Takes a directory name and opens the directory for scanning with SDNEXTFILE. Returns a handle to use with SDCLOSE.
SDNEXTFILE ... Take the handle of a directory and return the next directory entry. Each entry returns 5 values to the stack: name, attributes, file size, last modified date DD.MMYYYY and last modified time in HH.MMSS

There's a few commands still missing (like SDPURGE) and any others that might come up later.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: newRPL: [UPDATED July-14-16] Firmware for testing available for download - Claudio L. - 07-15-2016 02:40 AM

User(s) browsing this thread: 3 Guest(s)