Jump to content

V3.0.94 Unstable Available


Jon
 Share

Recommended Posts

  • Administrators

While writing the textpad/syntax scripts I had a nasty bug when I misspelt a variable. So I added a "MustDeclareVars" :whistle:

Also, numbers can be unmodified hotkeys now so CybeSlugs () should work.

3.0.94 (15th Feb, 2004)

- Added: WinGetCaretPos()

- Added: WinGetState()

- Added: MustDeclareVars (AutoItSetOption)

- Added: Editors page in help

- Fixed: Splash() and moveable flag

- Fixed: (Internal) Execute() recursion limit dropped to 384 levels

- FIxed: (Internal) Calls to Util_AttachThreadInput will not attach to hung windows

- Fixed: (Internal) some RegRead/RegWrite sizing problems (Ta, Chris)

Link to comment
Share on other sites

I assume you didn't modify anything so WinGetCaretPos() can return either relative or absolute coordinates? I added an AutoItSetOption to toggle between the two in a later release I sent to CyberSlug (After I had already sent the code to Jon). If you don't have that, you'll probably get requests for it (I know I did and I only had one person using my version :whistle: ).

Link to comment
Share on other sites

I'll just post here, it's not much different.

Add member:

bool m_bCaretClientCoord;

It needs initialized to false in the constructor.

In AutoItSetOption add:

else if (!stricmp(vParams[0].szValue(), "CaretCoordMode"))
{
    if (vParams[1].nValue() == 0)
        m_bCaretClientCoord = false;
    else
        m_bCaretClientCoord = true;
}

And in Win_GetCaretPos, add this before Util_VariantArrayDim(&vResult, 2)

if (!m_bCaretClientCoord)   // Means put them in screen coordinates
    ClientToScreen(hWnd, &point);
Link to comment
Share on other sites

  • Administrators

Yes I know what a ball-ache the changes are as I've just spent 30 mins updating all the help file generation scripts. Will give better flexibility in the future and FileWriteLine now does what its name suggests....

3.0.94 (16th Feb, 2004)

SCRIPT BREAKING CHANGES for FileReadLine and FileWriteLine:

FileWriteLine now automatically writes a DOS @CRLF pair UNLESS the last character of

the string to write is already @CR or @LF (to make it possible to write non-DOS text files)

FileReadLine will correctly read a DOS, UNIX or MAC line (@CRLF, @LF and @CR terminated respectively).

FileWrite and FileRead added to add further support.

CHANGE YOUR SCRIPTS AS FOLLOWS:

From: FileWriteLine($handle, "line" & @LF)

To: FileWriteLine($handle, "line" & @CRLF) or FileWriteLine($handle, "line")

From: FileWriteLine($handle, "line")

To: FileWrite($handle, "line")

- Added: FileWrite() and FileRead()

- Changed: FileReadLine() and FileWriteLine()

- Added: Eval() and IsDeclared()

- Added: CaretCoordMode (AutoItSetOption)

- Added: WinGetCaretPos()

- Added: WinGetState()

- Added: MustDeclareVars (AutoItSetOption)

- Added: Editors page in help

- Fixed: Splash() and moveable flag

- Fixed: (Internal) Execute() recursion limit dropped to 384 levels

- FIxed: (Internal) Calls to Util_AttachThreadInput will not attach to hung windows

- Fixed: (Internal) some RegRead/RegWrite sizing problems (Ta, Chris)

Link to comment
Share on other sites

3.0.94 (16th Feb, 2004)

SCRIPT BREAKING CHANGES for FileReadLine and FileWriteLine:

FileWriteLine now automatically writes a DOS @CRLF pair UNLESS the last character of

the string to write is already @CR or @LF (to make it possible to write non-DOS text files)

FileReadLine will correctly read a DOS, UNIX or MAC line (@CRLF, @LF and @CR terminated respectively).

FileWrite and FileRead added to add further support.

CHANGE YOUR SCRIPTS AS FOLLOWS:

From: FileWriteLine($handle, "line" & @LF)

To: FileWriteLine($handle, "line" & @CRLF) or FileWriteLine($handle, "line")

From: FileWriteLine($handle, "line")

To: FileWrite($handle, "line")

Jon,

FileAppend, This is line 1\nThis is line 2\n, myfile.txt\n\n

How this can be translated to AutoItV3 with this new handling,

I think it will be better to add a mode doing as <3.0.94

OPT("FileLineFeed",$mode)

:whistle:

Link to comment
Share on other sites

  • Administrators

Jon,

FileAppend, This is line 1\nThis is line 2\n, myfile.txt\n\n

How this can be translated to AutoItV3 with this new handling,

\n = @LF

FileWriteLine($handle, "This is line 1" & @LF & "This is line 2" & @LF ", myfile.txt" & @LF & @LF)

I think you probably meant something different...

Link to comment
Share on other sites

\n = @LF

FileWriteLine($handle, "This is line 1" & @LF & "This is line 2" & @LF ", myfile.txt" & @LF & @LF)

I think you probably meant something different...

Yes I do

Because now with the new strategy I get just LF inside the file not as before CRLF

So The OPT can be a solution to handle such difficulty, unless you propose an alternative.

Link to comment
Share on other sites

  • Administrators

No need for an OPT as until release as previous versions don't exist. :whistle:

Just use @CRLF then (if it is a DOS file...)

or @LF if you are writing to a file for UNIX, or just @CR if for a MAC

Link to comment
Share on other sites

No need for an OPT as until release as previous versions don't exist. :whistle:

Just use @CRLF then (if it is a DOS file...)

or @LF if you are writing to a file for UNIX, or just @CR if for a MAC

We need to change the StringFormat \n too

The V2 to V3 conversion is not as straight forward

Link to comment
Share on other sites

The CR LF differences only apply to disk files.

I agrre. But when you write FileWrite($handle,$line) with $line generated with StringFormat you get into the problem of \n generated in the middle of the string.

I don't understand for the time being all the consequence of this new change.

I will think about :whistle:

Link to comment
Share on other sites

  • Administrators

Jon, did you say at one point that you'd remove the limitation that prevents '(' and ')' from being set as hotkeys?

I just tried 3.0.94, and HotKeySet fails for those characters.

Ah, JP sent me an update and I copied it over the top, I bet that undid the change.
Link to comment
Share on other sites

  • Administrators

I agrre. But when you write FileWrite($handle,$line) with $line generated with StringFormat you get into the problem of \n generated in the middle of the string.

I don't understand for the time being all the consequence of this new change.

I will think about :whistle:

What's it got to do with stringformat? You can still do \r\n can't you if you intend to write the string to a file? Or just run it through StringAddCR()

It can't think of any other way to support all the file operations that everyone wants to do.

I undo all the changes and make v3 only support DOS formatted files if everyone wants?

This code in vbs:

Const ForReading = 1, ForWriting = 2
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("test.txt", ForWriting, True)
   f.WriteLine "123" & vblf & "456"

Produces the file:

31 32 33 0A 34 35 36 0D 0A

The same code in the new version of au3 produces the same output as the VB script. Under the old version it produced an extra CR in the middle:

31 32 33 0D 0A 34 35 36 0D 0A

Edited by Jon
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...