Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2267 closed Feature Request (Rejected)

Eval Flag (new Feature Request)

Reported by: DXRW4E Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

At present Eval() Returns the value of the variable, and possible to add a flag, so as to return the pointer of the variable, pointer to be used in autoit fuction with the ByRef

Eval() works really fast, in a test with a 200 MB array, works in about 0.040 seconds, so the speed is not the problem, but the memory in use

:example
;example $XArray[1000000] size 100 MB
Assign("$Array", $XArray, 2)
;;Once you have created the $Array, suppose that $XArray = ""

Global $a = Eval("Array")
Test($s) ;I have to take by force the $a, so that after use with ByRef, so in this case it uses 200 MB of memory

Func Test(ByRef $c)
ect ect
EndFunc

;it would be really nice to do so
Global $b = Eval("Array", 1) ;only return the pointer of $Array, pointer that is Ok with the ByRef mod

Test($b)
Func Test(ByRef $a)
ect ect
EndFunc

Sorry for my English

Attachments (0)

Change History (5)

comment:1 Changed 12 years ago by TicketCleanup

  • Version 3.3.8.1 deleted

Automatic ticket cleanup.

comment:2 Changed 12 years ago by trancexx

  • Resolution set to Rejected
  • Status changed from new to closed

Your English is not a problem.

No to the request. Function like Eval should be used only in extreme cases when there is no other way to access data (e.g. unknown number of function arguments). Extending its functionality would eventually lead to the abuse of usage.

comment:3 Changed 12 years ago by anonymous

I understand

Thank You

Ciao.

comment:4 Changed 12 years ago by anonymous

however to clarify the situation, what I was trying to do and an INF edit fuction, as well as Microsoft ago, the best way and create a handle, so as to be faster when reading or modification of the file

so I chose to do so, to imitate the handle in autoit , load inf file (so I can open many inf append ect ect), the fuction return inf handle, handle number (to be added at the end of the "INFNAMEXXX" variable name, to take the array with Eval) where and loaded the INF file

; $DX_HINF[0][0]
; $DX_HINF[1][0] = INF Handle
; $DX_HINF[1][1] = INF Path
; $DX_HINF[1][2] = INF Handle where this INF File has been Appended
; $DX_HINF[1][3] = INF Handle Appended
; $DX_HINF[1][4] = INF Variable Name
; $DX_HINF[1][5] = INF Handle of Default Strings Section
; $DX_HINF[1][6] = Last NOT Default INF Handle Strings Section

Func _DX_SetupOpenInfFile(ect ect ect)

ect ect ect

; $DX_SetupOpenInfFile[0] = Array Size
; $DX_SetupOpenInfFile[1] = Inf Path
; $DX_SetupOpenInfFile[2] = Section Number
; $DX_SetupOpenInfFile[3] = All Section Names - INFDataSeparatorChar & Section Names & Section Number Array, Read-Section example - StringRegExp($DX_SetupOpenInfFile[3], '\n' & "SectionName" & '\r([\n]+)', 3)
; $DX_SetupOpenInfFile[4] = LandID
; $DX_SetupOpenInfFile[5] = Inf Local Strings Section Name
; $DX_SetupOpenInfFile[6] = Inf Local Strings Section Array Number
; $DX_SetupOpenInfFile[7] = Inf Local Strings Section State (If Not KEY\Value pressent $DX_SetupOpenInfFile[7] = 0)
; $DX_SetupOpenInfFile[8] = Last NOT Default LandID
; $DX_SetupOpenInfFile[9] = Last NOT Default Inf Local Strings Section Name
; $DX_SetupOpenInfFile[10] = Last NOT Default Inf Local Strings Section Array Number
; $DX_SetupOpenInfFile[11] = Last NOT Default Inf Local Strings Section State (If Not KEY\Value pressent $DX_SetupOpenInfFile[7] = "")
; $DX_SetupOpenInfFile[12] = None
; $DX_SetupOpenInfFile[13] = Inf Encoding
; $DX_SetupOpenInfFile[14] = INFDataSeparatorChar
; $DX_SetupOpenInfFile[15] = First Lines of Inf ect ect
; $DX_SetupOpenInfFile[16] = "["
; $DX_SetupOpenInfFile[17] = "sectionaname1"
; $DX_SetupOpenInfFile[18] = "]"
; $DX_SetupOpenInfFile[19] = "space ect ect"
; $DX_SetupOpenInfFile[20] = "section data keyvalue ect ect"
; $DX_SetupOpenInfFile[21] = "space"
; $DX_SetupOpenInfFile[22] = "["
; $DX_SetupOpenInfFile[23] = "sectionaname2"
; $DX_SetupOpenInfFile[24] = "]"
; $DX_SetupOpenInfFile[25] = "space ect ect"
; $DX_SetupOpenInfFile[26] = "section data keyvalue ect ect"
; $DX_SetupOpenInfFile[27] = "space"

For $DX_SOIFH = 1 To $DX_HINF[0][0]

If Not $DX_HINF[$DX_SOIFH][0] Then ExitLoop

Next
If $DX_SOIFH > $DX_HINF[0][0] Then

ReDim $DX_HINF[$DX_SOIFH + $DX_SOIFH][7]
$DX_HINF[0][0] = $DX_SOIFH + $DX_SOIFH - 1

EndIf
If Not Assign("INFNAMEXXX" & $DX_SOIFH, $DX_SetupOpenInfFile, 2) Then Return SetError(4, 0, "")
ect ecty ect
$DX_HINF[0][1] += 1
Return SetError(0, AscW($DX_SOIFSC), $DX_SOIFH)

EndFunc

Func _DX_SetupOpenAppendInfFile($nameorhandleINF, $HandelINF)

ect ect

EndFunc

Func _DX_SetupGetSection($DX_infhandle, $DX_sectionaname, $DX_spaceflags = 3)

ect ect ect
If $DX_infhandle < 1 Or $DX_infhandle > $DX_HINF[0][0] Then Return SetError(2, 0, "")
Local $DX_SGSE = 0, $DX_SOIFGS = Eval($DX_HINF[$DX_infhandle][4])
If Not IsArray($DX_SOIFGS) Then Return SetError(3, 0, _DX_SetupCloseInfFile($DX_HINF[$DX_infhandle][0]))
ect ect ect
Local $DX_SOAIFGS = $DX_HINF[$DX_infhandle][3], $DX_SGSE = 0, $DX_SGSD, $DX_SGSN = StringRegExp($DX_SOIFGS[3], '(?is)\n\Q' & StringReplace($DX_SGSSN, "\E", "\e", 0, 1) & '\E\r([\n]+)', 3)
ect ect ect

If BitAND($DX_spaceflags, 3) Then

$DX_SGSD = $DX_SOIFGS[$DX_SGSN[0] + 3]

ElseIf BitAND($DX_spaceflags, 1) Then

$DX_SGSD = $DX_SOIFGS[$DX_SGSN[0] + 3] & $DX_SOIFGS[$DX_SGSN[0] + 4]

ElseIf BitAND($DX_spaceflags, 2) Then

$DX_SGSD = $DX_SOIFGS[$DX_SGSN[0] + 2] & $DX_SOIFGS[$DX_SGSN[0] + 3]

Else

$DX_SGSD = $DX_SOIFGS[$DX_SGSN[0] + 2] & $DX_SOIFGS[$DX_SGSN[0] + 3] & $DX_SOIFGS[$DX_SGSN[0] + 4]

EndIf

ect ect ect
If $DX_SOAIFGS Then ;append if file exists, read what ect ect

ect ect ect

endif

EndFunc

so basic idea ninth work with pointer in autoit, but imitate a handle in autoit, however and all Ok (I understood what you meant above). this was just to clarify the situation or or what I wanted to do with EVAL

Ciao.

comment:5 Changed 12 years ago by Jpm

Eval() is a function which leads AutoIt software to be considerd as a malware.
I am afraid this request will extend it more ...

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.