Curious: How does System.SimpleRead work?

Under the hood, I mean. I know how to use it, but how exactly does it work? What's it doing in the system? And what happens when you try to read a file that doesn't exist?

 

7,717 views 10 replies
Reply #1 Top

Up until a recent Microsoft Office update, it seemed System.Simpleread did nothing when trying to read a file that didn't exist. Now, it crashes the program. Took hours upon hours to figure that was the source of the problem. Which is why I ask if system.simplread is doing anything with Office or Sharepoint.

Reply #2 Top

I'll try to find out.

Reply #3 Top

It's system reader for simple people like me.....

 

Reply #4 Top

Sorry... :inlove:

Reply #5 Top

Thanks, Zu.

lol @ Jim. :grin:

Reply #6 Top

For what it's worth, here's the Windows error I kept getting for my program:

 

Problem Event Name: APPCRASH

Application Name: netmessenger2_1.exe

Application Version: 0.0.0.0

Application Timestamp: 4b900caa

Fault Module Name: StackHash_fd5e

Fault Module Version: 6.1.7601.17725

Fault Module Timestamp: 4ec49b60

Exception Code: c0000374

Exception Offset: 000c380b

OS Version: 6.1.7601.2.1.0.256.1

Locale ID: 1033

Additional Information 1: fd5e

Additional Information 2: fd5e1090ca80046438fe8c5bc3e2c26f

Additional Information 3: 5fcb

Additional Information 4: 5fcb4ee5fa80075cf546dea713f2bcbe

Reply #7 Top

People have been poked.

Reply #8 Top

System.SimpleRead(path, param)

It reads a file from disk to a string variable.

Only param=1 is currently supported.

Example:

txtLog = System.SimpleRead(baseDir & "Data\mylog", 1)

Reply #9 Top

I have the source code . . .   :rolleyes:

Basically it reads a full text document passed in the first parameter and returns a string with the file content.

The second parameter must be ‘1’.
 
From there you can (should) be able to parse the content or display it .  . but beyond that . . . I got nothing.
Reply #10 Top

Thanks for looking into it. I was pretty sure it didn't used to conk when it tried to read a file that didn't exist. For this gadget I'll just have to go with FileSystemObject, instead.