Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#678 closed Bug (No Bug)

MAX_LINESIZE confine arrays

Reported by: dutCh Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.1 Severity: Blocking
Keywords: MAX_LINESIZE arrays Cc:

Description

Please remove this unneeded restriction. I want dim arrays with size much bigger than 4KB.

dim $aDlg[100][8] = [[...], _
  [...], _
  [...]]

This hole thing can only be 4KB!!

We have found a workaround with diming several arrays <4KB and an for-loop in the code. But thats not very cool and imho unneeded.

Why not take the problem at the root and enhance the parsing:

Dim $aArr[][] = [[ ],

A define of a 2-dim array, equal sign, 2 open brackets, stuff, one close, an comma... you realize that an dim that array - with no size limit. Thats not an error - stupid user forgot to close the braces - only an multi-dim array!!?

And why not do a heck of a job and kick this "_" too? I'm in an array dim. I have an closed bracked, a comma, KICK ALL WHITESPACE, and await and got the next open bracket. Thats simple, isn't it?

AutoIt should make the things easier. And cooler!

What do you think?

---
However, thanx for that great tool. Is much of fun for me!!

Attachments (1)

Norton95.au3 (11.0 KB) - added by dutCh 16 years ago.
shows the enforced work with confined arrays. BAD!!

Download all attachments as: .zip

Change History (7)

Changed 16 years ago by dutCh

shows the enforced work with confined arrays. BAD!!

comment:1 follow-up: Changed 16 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

AutoIt is line based. The line limit is 4096 characters per line. There is no plan to change this.

comment:2 in reply to: ↑ 1 Changed 16 years ago by dutCh

Replying to Valik:

AutoIt is line based. The line limit is 4096 characters per line. There is no plan to change this.


Okay, AutoIt is line based. Otherwise you would need something like a preprocessor. Understandable.

But why this ridiculous limit of 4KB? A PC today has one million times more RAM, not to count virtual memory!??

You define a constant for the size of a single code line. For some reason you don't like dynamic memory management. Okay. It's a design decision.

Take this into account, here comes an easy solution: Supply a factor!

Let the constant MAX_LINESIZE = 4096 be the default. Factor 1. And give another constant for free extensibility! :-)

#define ENOUGH_RAM_FOR_ALL = 1 ;default
#define MAX_LINESIZE = 4096 * ENOUGH_RAM_FOR_ALL

Who needs can adjust this.

No design changes are required. Easy to implement. Kicked the main limit of AutoIt!

Welcome in the world of gigabyte ram!

comment:3 Changed 16 years ago by Valik

Wow, thanks. Now fuck off and stop using this language. Clearly you consider us complete idiots incapable of even the most basic thought.

Here's a thought? Don't write your code like that. That's not the only way to create an array, you know? Or is it more convenient to bitch about problems and then insult our intelligence by implying we don't have enough knowledge to know how to not use magic numbers in our code.

comment:4 follow-up: Changed 16 years ago by dutCh

Sorry. No offense meant. I'm not a native English speaker. Please be indulgent with me.

Maybe its about you master the complicated part, make a huge, impressive work. And this easy little detail - there is no way.

I want only point out a constraint in AI and thats seems to me that there are no logical reason therefor.

Please show me another cool way to populate my array.

Uncool are:

  • I supply an extra file, open it, read it, parse it

and too:

  • I must give a Dim befor every single array line

Currently i define multiple arrays <4KB and use a for loop to process them one after another.

Thank you.

And let me state again: AutoIt is a cool tool!

comment:5 in reply to: ↑ 4 Changed 16 years ago by Valik

Replying to dutCh:

Please show me another cool way to populate my array.

#include <Array.au3>

Local $a[1][2]

ArrayData_PushBack($a, 0, "abc", "def")
ArrayData_PushBack($a, 1, "ghi", "jkl")

_ArrayDisplay($a)

Func ArrayData_PushBack(ByRef $a, $nIndex, $data1, $data2)
	Do
		Local $nSize = UBound($a)
		If $nIndex >= $nSize Then
			ReDim $a[($nSize + 1) * 1.5][UBound($a, 2)]
			$nSize = UBound($a)
		EndIf
	Until $nSize > $nIndex
	$a[$nIndex][0] = $data1
	$a[$nIndex][1] = $data2
EndFunc

There are other more clever things you can do to make the code even better.

comment:6 Changed 16 years ago by dutCh

Thank you. You're right. There's more than one way to skin a cat!

PS: Is that really an english idiom. In Germany we say "Viele Wege führen nach Rom. - Many ways lead to Rome."

Where the hell did the cat came from? Alf? ;-)

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.