Rihards Balass / 4DGL-mbed-32PTU
Revision:
27:dbf79d116497
Parent:
26:c6a803706a42
--- a/demo.cpp	Wed Sep 28 12:41:32 2016 +0000
+++ b/demo.cpp	Thu Sep 29 19:40:53 2016 +0000
@@ -110,7 +110,26 @@
     
     sprintf(buf, "\r\nFile %i Close = %s", h1, file_Close(h1) ? "true" : "false");
     puts(buf);
+    wait_ms(LONG_WAIT);
+    cls();
     
+    h1 = file_Open("1.txt", OPEN_READ);
+    err = file_Error();
+    if (err == 0) sprintf(buf, "\r\nnewfile.txt handle = %i", h1);
+    else sprintf(buf, "\rFile Open error = %i", err);
+    puts(buf);
+    
+    for (i = 0; i < 3; i++) {
+        clearBuf(fileReadBuf, BUFFER_SIZE);
+        count = file_GetS(30, h1, fileReadBuf);
+        sprintf(buf, "\r\nRead %i bytes", count);
+        puts(buf);
+        sprintf(buf, "\r\nData: %s", fileReadBuf);
+        puts(buf);
+    }
+    
+    
+    /*
     short h2 = file_Open("scr.png", OPEN_APPEND);
     file_ScreenCapture(10, 10, 200, 100, h2);
     file_Close(h2);
@@ -120,7 +139,7 @@
     
     h2 = file_Open("pic.bmp", OPEN_READ);
     file_Image(5, 5, h2);
-    
+    */
     /*
     h1 = file_Open("newfile.txt", OPEN_APPEND); // try appending to file
     err = file_Error();