Curious: How does System.SimpleRead work?

Wednesday, May 2, 2012 by sViz | Discussion: DesktopX

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?

 

sViz
Reply #1 Thursday, May 3, 2012 5:36 PM

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.

ZubaZ
Reply #2 Thursday, May 3, 2012 8:29 PM

I'll try to find out.

RedneckDude
Reply #3 Thursday, May 3, 2012 9:26 PM

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

 

RedneckDude
Reply #4 Thursday, May 3, 2012 9:27 PM

Sorry...

sViz
Reply #5 Thursday, May 3, 2012 10:34 PM

Thanks, Zu.

lol @ Jim.

sViz
Reply #6 Monday, May 7, 2012 11:38 AM

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

ZubaZ
Reply #7 Monday, May 7, 2012 1:36 PM

People have been poked.

ZubaZ
Reply #8 Monday, May 7, 2012 1:58 PM

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)

ZubaZ
Reply #9 Wednesday, May 9, 2012 4:42 PM

I have the source code . . .  

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.
sViz
Reply #10 Friday, May 11, 2012 12:00 PM

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.

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01