Jump to content

Recommended Posts

Posted

Thanks @ioa747, I like the implementation too 👍 .

One little thing:
In frame type/mode 0 ($iFrame = 0), the table will be generated without any frame (border). But there is a leading whitespace for each table row which is unnecessary in my opionion. Do you mind to change the code to get rid of that? Of course I could do it on my own, but maybe it's also good for all others here. What do you think?

Best regards
Sven

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

Is it okay when I use your function to add two more modes?
I would add a markdown table format and a gherkin feature table format.

If I would use your code in any of my open source project, I would refer to you (naming and link).

👉 Markdown table format:

Spoiler
| Item              | In Stock | Price |
| :---------------- | :------: | ----: |
| Python Hat        |   True   | 23.99 |
| SQL Hat           |   True   | 23.99 |
| Codecademy Tee    |  False   | 19.99 |
| Codecademy Hoodie |  False   | 42.99 |

👉 Gherkin feature table format:

Spoiler
Given the following users exist:
  | name   | email              | twitter         |
  | Aslak  | aslak@cucumber.io  | @aslak_hellesoy |
  | Julien | julien@cucumber.io | @jbpros         |
  | Matt   | matt@cucumber.io   | @mattwynne      |

Best regards
Sven

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

@SOLVE-SMART  update to Version: 0.2

without   leading whitespace in $iFrame = 0

 

16 minutes ago, SOLVE-SMART said:

Is it okay when I use your function to add two more modes?

Of course, feel free to use it
Adding these features sounds really cool. I can't wait to see the result.  :)

I know that I know nothing

Posted
48 minutes ago, ioa747 said:

Of course, feel free to use it

Nice, thanks.

44 minutes ago, ioa747 said:

Adding these features sounds really cool. I can't wait to see the result.  :)

I will share the code, but I won't add the features to your function(s). I would use my own code style and my own use cases. Therefore not all of your frame types will be applied in my version - just to mention it 😆 . In other words, it would not be that dynamic and UDF-like, because I focus on specific use cases not on plenty of variants.

Best regards
Sven

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

  • Solution
Posted (edited)
16 hours ago, ioa747 said:

update to Version: 0.3

I added functionality to accept and array as input.
I renamed $iString to $vString, and now it verifies whether $vString is an array and converts it to a string as needed.

Edited by ioa747

I know that I know nothing

Posted
1 hour ago, ioa747 said:

I added functionality to accept and array as input.
I renamed $iString to $vString, and now it verifies whether $vString is an array and converts it to a string as needed.

That's exactly what I would do, because (at least in my opinion) with AutoIt we handle Arrays or the array data all the time. It's more common to transform array data to such a table instead of a with TABs separated string. Thank you very much @ioa747 for v0.3 👌 .

Best regards
Sven

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted (edited)
On 5/6/2025 at 8:13 PM, SOLVE-SMART said:

I will share the code, but I won't add the features to your function(s). I would use my own code style and my own use cases. Therefore not all of your frame types will be applied in my version - just to mention it 😆 . In other words, it would not be that dynamic and UDF-like, because I focus on specific use cases not on plenty of variants.

FYI @ioa747, I created a (temporary) GitHub repository with your library (UDF functions) to find myself in a better structured way. This is my way of doing such things and has nothing to do with your previous preparation of the topic or the UDF. It simply helps me.

https://github.com/sven-seyfert/data-to-table

In this repo. I want to change some code parts, like I mentioned before regarding "markdown tables" or "gherkin feature tables". So I can share the diffs by commits and so on. But please don't expect too much ... your UDF is already very good and I just want to adjust that work for my specific use cases.

⚠ After that, I guess I would share the code here in the forum and would remove this temporary repository.

Best regards
Sven

Edited by SOLVE-SMART

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

Hi @ioa747 👋 ,

first I refactored your code to apply my code styling, but then I realized I do a complete rewrite. So I decided to create a new UDF-like function. Thanks again for your original logic and code, I will enhance the UDF by additional tables, like mentioned before. What I did so far can be found here.

Best regards
Sven

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted

My initial thought with this was to make some elegant and beautiful MsgBox's, particularly  About dialogs, etc.

But I realized that the output from _stringtotable simply wasn't lining up properly in a MsgBox. So I decided try it with the ExtMsgBox UDF since it has more customizing options. That also came up all scrambled.

Until... I realized that I would need to use a monospaced font like in other projects. Cascadia Mono didn't look as nice. So I did Consolas and it looked great.

Basically, the following code was added:

#include "ExtMsgBox.au3"

_ExtMsgBoxSet(1, 4, 0x202020, 0xe0e0e0, -1, "Consolas", 1200, 1200)
_ExtMsgBox (0, 0, "_ExtMsgBox", $sOut)

The _ExtMsgBox (0, 0, "_ExtMsgBox", $sOut) just needed to be adapted into the right area of examples, of course.

Screenshots:

Spoiler

image.png.ee704ed05160afbb78bb884ece786949.png

image.png.4c4ca1236b3de537a3a98c43798402b5.png

 

So this opens up some nice possibilities for my usage of it. Thanks again for sharing this. Also, @SOLVE-SMART I am going to follow your progress on this as well.

Posted
On 5/6/2025 at 6:38 PM, ioa747 said:

update to Version: 0.4

I added the ability for 1D array,
and floating point as format , to control digits after decimal point [0-3]f
e.g.  0f, for no  decimal point,   , 2f for 2 digits after decimal point

I know that I know nothing

Posted
╔══════════════════════╦══════════╦════════╦══════════╦═══════════╦════════╦═════════╦════════╗
║ name                 ║ time[ms] ║ factor ║ Std. Dev ║ Std. Err. ║    min ║     max ║  range ║
╠══════════════════════╬══════════╬════════╬══════════╬═══════════╬════════╬═════════╬════════╣
║ StringRegExp only    ║    1.691 ║   1.00 ║    0.351 ║     0.035 ║  1.304 ║   3.167 ║  1.863 ║
║ jq UDF               ║   32.933 ║  19.48 ║    2.929 ║     0.293 ║ 29.308 ║  43.169 ║ 13.861 ║
║ JsonC-UDF            ║   51.086 ║  30.21 ║    3.205 ║     0.321 ║ 45.625 ║  63.460 ║ 17.835 ║
║ pure AutoIt JSON-UDF ║   97.916 ║  57.90 ║    5.685 ║     0.569 ║ 86.362 ║ 113.467 ║ 27.105 ║
║ JSMN-based JSON-UDF  ║  108.248 ║  64.01 ║    5.512 ║     0.551 ║ 99.029 ║ 130.864 ║ 31.835 ║
╚══════════════════════╩══════════╩════════╩══════════╩═══════════╩════════╩═════════╩════════╝
... ...
    Local Const $TL = "╔", $TR = "╗", $BL = "╚", $BR = "╝"
    Local Const $H = "═", $V = "║", $C = "╬"
    Local Const $TH = "╦", $CH = "╩", $LH = "╠", $RH = "╣"
... ...

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted
╔══════════════════════╤══════════╤════════╤══════════╤═══════════╤════════╤═════════╤════════╗
║ name                 │ time[ms] │ factor │ Std. Dev │ Std. Err. │    min │     max │  range ║
╟──────────────────────┼──────────┼────────┼──────────┼───────────┼────────┼─────────┼────────╢
║ StringRegExp only    │    1.691 │   1.00 │    0.351 │     0.035 │  1.304 │   3.167 │  1.863 ║
║ jq UDF               │   32.933 │  19.48 │    2.929 │     0.293 │ 29.308 │  43.169 │ 13.861 ║
║ JsonC-UDF            │   51.086 │  30.21 │    3.205 │     0.321 │ 45.625 │  63.460 │ 17.835 ║
║ pure AutoIt JSON-UDF │   97.916 │  57.90 │    5.685 │     0.569 │ 86.362 │ 113.467 │ 27.105 ║
║ JSMN-based JSON-UDF  │  108.248 │  64.01 │    5.512 │     0.551 │ 99.029 │ 130.864 │ 31.835 ║
╚══════════════════════╧══════════╧════════╧══════════╧═══════════╧════════╧═════════╧════════╝

..that takes more coding ( edited by hand above ). The question is: how far is this going to be taken ?, ... the original is good as far as prettifying a table to separate the content from the header and delimiting columns. Other than that, what's the use ?. My 2 cents

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted (edited)

First of all and to clarify: I don't see this as a competition - just in case you folks would think of this regarding @ioa747 and me 😆 .

On 5/8/2025 at 5:28 PM, WildByDesign said:

Would you be willing to add another $iFrame option?

On 5/8/2025 at 7:16 PM, argumentum said:

the original is good as far as prettifying a table to separate the content from the header and delimiting columns. Other than that, what's the use

I agree. I guess extending the border styles (frame types) is just a gimmick.

Nevertheless, I played a bit with my version of DataToTable.au3 which lead to v0.2.0. In the README.md section output-result you can see a fourth border style "4=BorderAndHeaderEdgesWithAccent" as a example. In the CHANGELOG.md you will find how I changed it. To achieve the styling above (shared by @argumentum) it would lead to some more code adjustments, but at the moment I don't have the desire to implement it - sorry @WildByDesign 😅 .

Best regards
Sven

 

Edited by SOLVE-SMART

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Posted
13 hours ago, WildByDesign said:

it would be good to have an option that does a border for only the outer frame of the table.


I agree with  argumentum  above,  it's easier to do everything with double lines, than just the outline.
Adding more frame types, requires more nested if, then , which has implications for all frame types.

I'm thinking of removing frame =2 as well, right now it doesn't seem appealing to me, it will reduce both response time and readability of the script. as well

However, the idea is not bad, and it's nice to get what you want.
For this (and for the coding challenge)
in the next version I will put a helper function that will do it.
Which, (those reading) can have by now  :)
 

#include <Array.au3>
#include <String.au3>

_test()

;---------------------------------------------------------------------------------------
Func _test()
    Local $sTxt, $sOut
    Local $sData = _
            "Company" & @TAB & "Contact" & @TAB & "Revenue" & @CRLF & _
            "Alfreds Futterkiste" & @TAB & "Maria Anders" & @TAB & "1200" & @CRLF & _
            "Centro Moctezuma" & @TAB & "Francisco Chang" & @TAB & "950" & @CRLF & _
            "Island Trading" & @TAB & "Helen Bennett" & @TAB & "15800"

    $sOut = _DblFrame($sData, @TAB, "L,C,R")
    ConsoleWrite($sOut & @CRLF & @CRLF)
EndFunc   ;==>_test
;---------------------------------------------------------------------------------------
Func _DblFrame($vString, $sSeparator = @TAB, $sAlign = "")
    Local $sData = _StringToTable($vString, 3, $sSeparator, $sAlign)
    Local $aData = StringSplit($sData, @LF, 3)
    Local $iCnt = UBound($aData) -1
    Local $sOut

    For $i = 0 To $iCnt
        Switch $i
            Case 0
                $aData[$i] = StringReplace($aData[$i], "┌", "╔", 1, 2)
                $aData[$i] = StringReplace($aData[$i], "─", "═", 0, 2)
                $aData[$i] = StringReplace($aData[$i], "┬", "╤", 0, 2)
                $aData[$i] = StringReplace($aData[$i], "┐", "╗", -1, 2)
            Case 2
                $aData[$i] = StringReplace($aData[$i], "├", "╟", 1, 2)
                $aData[$i] = StringReplace($aData[$i], "┤", "╢", -1, 2)
            Case $iCnt
                $aData[$i] = StringReplace($aData[$i], "└", "╚", 1, 2)
                $aData[$i] = StringReplace($aData[$i], "─", "═", 0, 2)
                $aData[$i] = StringReplace($aData[$i], "┴", "╧", 0, 2)
                $aData[$i] = StringReplace($aData[$i], "┘", "╝", -1, 2)
            Case Else
                $aData[$i] = StringReplace($aData[$i], "│", "║", 1, 2)
                $aData[$i] = StringReplace($aData[$i], "│", "║", -1, 2)
        EndSwitch
        $sOut &= $aData[$i] & @CRLF
    Next

    Return $sOut

EndFunc   ;==>_DblFrame

 

I know that I know nothing

Posted (edited)

Hi folks 👋 ,

I spend a bit freetime and created version v0.3.0 of data-to-table.au3 UDF.

  • 8 different border styles
  • a flexible way of adding more border styles (tiny how-to follows in the next days (I hope))
  • what has changed ==> CHANGELOG
  • how it looks ==> output-result

Once again, kudos to @ioa747 for his idea and main logic behind it. I changed your version drastically, but you approach is still in my coding heart 🤭 .

💡 For now, I am temporary done with this library, until I will have more time for this. If you guys find BUGs or do have suggestions, I really appreciate your feedback - thanks 🤝 .

Btw. @WildByDesign, your style request from @argumentums post here, is border style variant 8 "double-outter-border-and-header-with-single-inner-border" 😀 .

╔════════════╤════════════════╤═════════════════╤═════════════════════════════════════════╗
║ Language   │ Popularity (%) │   Job Demand    │                             Typical Use ║
╟────────────┼────────────────┼─────────────────┼─────────────────────────────────────────╢
║ JavaScript │           62.3 │    Very High    │       Web Development, Frontend/Backend ║
║ C#         │           27.1 │      High       │ Game Development, Windows Apps, Web Dev ║
║ Go         │           13.8 │     Growing     │      Cloud Services, System Programming ║
║ PowerShell │           13.5 │ Low to Moderate │   Task Automation, DevOps, System Admin ║
║ AutoIt     │            0.5 │       Low       │       Windows GUI Automation, Scripting ║
╚════════════╧════════════════╧═════════════════╧═════════════════════════════════════════╝

If you like the UDF, consider to star the project on GitHub, thanks.

Best regards
Sven

Edited by SOLVE-SMART

==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

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
  • Recently Browsing   0 members

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