Jump to content
Sign in to follow this  
GEOSoft

Should _FileReadToArray() be changed?

Recommended Posts

GEOSoft

I have run into at least 3 cases now where _FileReadToArray() fails. All were htm files and I've discovered it's becuse those pages do not contain @LF. They do however contain @CR. I just re-wrote my version of it to check for @LF. If it doesn't exist then split on @CR, otherwise use the old method of stripping @CR and splitting on @LF. It works fine, I'm just wondering if this is a change that should be made in the standard include file. I'm open to any opinions.

The new function code will not break old scripts.

You can see it here

Second from the bottom.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Xenobiologist

I have run into at least 3 cases now where _FileReadToArray() fails. All were htm files and I've discovered it's becuse those pages do not contain @LF. They do however contain @CR. I just re-wrote my version of it to check for @LF. If it doesn't exist then split on @CR, otherwise use the old method of stripping @CR and splitting on @LF. It works fine, I'm just wondering if this is a change that should be made in the standard include file. I'm open to any opinions.

The new function code will not break old scripts.

You can see it here

Second from the bottom.

Hi,

which version? see here http://svn.autoitscript.com/trac/ticket/198

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
GEOSoft

Hi,

which version? see here http://svn.autoitscript.com/trac/ticket/198

Mega

It's been the same issue in all versions and it has nothing to do with that ticket. The problem is, if the file that you read does not contain a @LF then the function will fail. That's because there is no code in it to check for that possibility and it's actually a fairly common scenario.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Valik

I mentioned in that ticket that it would fail with @CR-only files. I guess that wasn't incorporated into the fix.

The answer is yes, it should be changed, so if you want to create a ticket and post your fix that would be fine.

Share this post


Link to post
Share on other sites
GEOSoft

I mentioned in that ticket that it would fail with @CR-only files. I guess that wasn't incorporated into the fix.

The answer is yes, it should be changed, so if you want to create a ticket and post your fix that would be fine.

Thanks Valik. I'll get at it right away.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.