Jump to content

Red output text from SQLite?


Edifice
 Share

Recommended Posts

When doing this:

$iRval = _SQLite_GetTable2d (-1, "SELECT * FROM datas", $aResult, $iColumns, $iRows)
    If $iRval = $SQLITE_OK Then
        _SQLite_Display2DResult($aResult)
    Else
        MsgBox(0,"ERROR","Query error! 2")
    EndIf

To my database, and hitting the F5, I get the output from the database on-screen.

That's all fine. The weird thing is that some of the text-output in written in red, and the red stops in the middel of a colum.

Anyone know why?

Edited by Edifice
Link to comment
Share on other sites

When doing this:

$iRval = _SQLite_GetTable2d (-1, "SELECT * FROM datas", $aResult, $iColumns, $iRows)
    If $iRval = $SQLITE_OK Then
        _SQLite_Display2DResult($aResult)
    Else
        MsgBox(0,"ERROR","Query error! 2")
    EndIf

To my database, and hitting the F5, I get the output from the database on-screen.

That's all fine. The weird thing is that some of the text-output in written in red, and the red stops in the middel of a colum.

Anyone know why?

I have seen that, and not only with SQLite data. The SciTE console interprets certain escape seqences for text color changes, font, bold, etc. Sometimes the strings you pass to ConsoleWrite() just coincidentally contain those sequences.

I never looked that deeply into the SciTE docs, but if you track down the exact control data the console uses you could even use that on purpose to color tag your text.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Same. I was once outputting a STDOUT and the first few lines were blue :P

The easiest way is just by the first character of a line

ConsoleWrite("! somethjing red" & @CR)
ConsoleWrite("> something bluue" & @CRLF)
ConsoleWrite("- something orange" & @CRLF)
ConsoleWrite("+ something green" & @CRLF)
Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

The easiest way is just by the first character of a line

ConsoleWrite("! somethjing red" & @CR)
ConsoleWrite("> something bluue" & @CRLF)
ConsoleWrite("- something orange" & @CRLF)
ConsoleWrite("+ something green" & @CRLF)
But I was only outputting things like:

1536272
1092939
2030303
2728304
5695894

(Example).

Link to comment
Share on other sites

But I was only outputting things like:

1536272
1092939
2030303
2728304
5695894

(Example).

Yep.

ConsoleWrite(1536272)
ConsoleWrite(1092939)
ConsoleWrite(2030303)
ConsoleWrite(2728304)
ConsoleWrite(5695894)

Output:

+>17:38:38 AU3Check ended.rc:0

>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\Scripts\Test_1.au3"

15362721092939203030327283045695894+>17:38:39 AutoIT3.exe ended.rc:0

+>17:38:40 AutoIt3Wrapper Finished

>Exit code: 0 Time: 2.458

Interesting.

@martin: Did you just poke around and find that by trial and error, or did you find a reference in the SciTE docs?

:P

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Yep.

ConsoleWrite(1536272)
  ConsoleWrite(1092939)
  ConsoleWrite(2030303)
  ConsoleWrite(2728304)
  ConsoleWrite(5695894)

Output:

Interesting.

@martin: Did you just poke around and find that by trial and error, or did you find a reference in the SciTE docs?

:P

I just noticed that when lines are red there is usually '!' as the first character so I tried different characters.

In Scintilla there are different character sets or styles that can be defined. Each set can have, among other things, a colour. So if you can find out which set has the colour red, then I imagine that you could send a message to SciTE to switch to that set then send the text. I got as far as finding

SCI_STYLEGETFORE(int styleNumber)

but I could find the definitions for the messages.

I searched for posts about coloured text in SciTE and found an old post which was similar to mine but the characters gave different colours, so I assume Jos has changed the colours of the defined sets at some time, or the post was just wrong.

BTW, I get a pale purple colour not red for the ConsolWrite code you posted, but it seems to be that colour for any text posted without @CR.

Eg

ConsoleWrite("THERE IS NO END TO IT")

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Weird huh! I understand a little bit better why though, still possibly a bug?

If so, it would be on Scintilla SciTE, not SciTE4AutoIt3.

Maybe Jos would offer an opinion...

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Here are my older notes:

ConsoleWrite('! = Red' & @LF)
ConsoleWrite('> = Blue' & @LF)
ConsoleWrite('- = Orange' & @LF)
ConsoleWrite('+ = Green' & @LF)
ConsoleWrite('(5) : = Red (jump to line 5 when double-clicked)' & @LF)
ConsoleWrite('Start with String or Integer then ' & @TAB & '6' & ' = Pink (jump to line 6 when double-clicked)' & @LF)


ConsoleWrite('(' & @ScriptLineNumber & ') : = Red (jump to line ' & @ScriptLineNumber & ' when double-clicked)' & @CRLF)
Link to comment
Share on other sites

  • Developers

As stated by Martin: there are a couple of "first characters" that SciTE uses to give a Outputpane line a color.

On top of that SciTE is trying to recognise errors generated by compiler/linker programs and giving them a color.

The reason this line :

15362721092939203030327283045695894+>17:38:39 AutoIT3.exe ended.rc:0

has the start of it in red is simply because it adheres to one of these formats.

Specificallly:

// Look for one of the following formats:

// GCC: <filename>:<line>:<message>

// Microsoft: <filename>(<line>) :<message>

// Common: <filename>(<line>): warning|error|note|remark|catastrophic|fatal

// Common: <filename>(<line>) warning|error|note|remark|catastrophic|fatal

// Microsoft: <filename>(<line>,<column>)<message>

// CTags: \t<message>

// Lua 5 traceback: \t<filename>:<line>:<message>

// Lua 5.1: <exe>: <filename>:<line>:<message>

and the color changes when you change this line in Others.properties:

# gcc Error

style.errorlist.2=fore:#800080

We use this feature in au3check and tidy.

For all details you could have a look at RecogniseErrorListLine() in LexOthers.cxx.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

You Americans with your missing letters. You ruined our language :unsure:

Also, has anyone sent a bug report to the developers of ScITE.

Look again at Jos's post.

I don't think it would be accepted as a bug, because it is a configurable pattern match. If you don't like the behavior, you could change the patterns that get highlighted.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

U brits with your colours :-)

:P Putting two u's in blue was a bit over the top I admit. Glad youu slotted that.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Developers

Look again at Jos's post.

I don't think it would be accepted as a bug, because it is a configurable pattern match. If you don't like the behavior, you could change the patterns that get highlighted.

:P

Yea this particular bug is commonly referred to as a feature :unsure:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...