Jump to content

Array access on expression & first element


DXRW4E
 Share

Recommended Posts

 

in poor words ($aArray) for now has no function in Autoit (always return None, if you do not use the Array access on expression)

Untrue: (expression) = expression AFAIK

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Hi jchd, but of course I know that ehhh, but except in cases of Array variable
 

Local $aArray = [555, 444, 333]

If $aArray Then
    ConsoleWrite("1" & @LF)
;ElseIf $aArray[0] Then  ;True - Array access normal
;    ConsoleWrite("2" & @LF)
;ElseIf ($aArray)[0] Then  ;True - Array access on expression mod
;    ConsoleWrite("2" & @LF)
ElseIf ($aArray) Then  ;Improvement (Feature) Request
    ConsoleWrite("2" & @LF)
Else
    ConsoleWrite("3" & @LF)
EndIf

;~ >Running:(3.3.10.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\DXRW4E\Desktop\New AutoIt v3 Script (2).au3"    
;~ --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
;~ 3
;~ +>13:35:55 AutoIt3.exe ended.rc:0
;~ >Exit code: 0    Time: 0.321

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Link to comment
Share on other sites

I still don't see what that confusing new syntax would bring, except confusion.

I'm pretty sure I and zillions others have written things like:

If ($a) Then
...

being used to C or for whatever reason.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

I still don't see what that confusing new syntax would bring, except confusion.

I'm pretty sure I and zillions others have written things like:

If ($a) Then
...
being used to C or for whatever reason.

 

there are a lot of differences, StringSplit always return arrays so never happens error, but it is very useful in cases happens error, to give an example

;ERROR, if error happens during Dllcall, name.dll not found or other
Return (DllCall("name.dll", "int", "FuncName", "str", "", "int", 111))[0]

;is always OK, even if error happens during Dllcall, name.dll not found or other
Return (DllCall("name.dll", "int", "FuncName", "str", "", "int", 111)) ;Improvement (Feature) Request
is the same thing also during the Comparison or Assignment or anything like that, so never go in error, even if variable is arrays or not, here is to avoid these errors

Local $aTest[4] = ["One","Two","Three","Four"], $sTest, $aTest2
$sTest = ($aTest) ;Improvement (Feature) Request
ConsoleWrite("$sTest - " & $sTest & @LF)
$sTest = ($aTest)[0]
ConsoleWrite("$sTest - " & $sTest & @LF)
$aTest2 = "Two"
$sTest = ($aTest2) ;Improvement (Feature) Request
ConsoleWrite("$sTest - " & $sTest & @LF)
$sTest = ($aTest2)[0]
ConsoleWrite("$sTest - " & $sTest & @LF)

;~ >Running AU3Check (3.3.11.1)  from:C:\Program Files (x86)\AutoIt3\Beta
;~ +>02:50:57 AU3Check ended.rc:0
;~ >Running:(3.3.11.1):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "C:\Users\DXRW4E\Desktop\New AutoIt v3 Script.au3"    
;~ --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
;~ $sTest -
;~ $sTest - One
;~ $sTest - Two
;~ "C:\Users\DXRW4E\Desktop\New AutoIt v3 Script.au3" (10) : ==> Subscript used on non-accessible variable.:
;~ $sTest = ($aTest2)[0]
;~ $sTest = ($aTest2)^ ERROR
;~ ->02:50:57 AutoIt3.exe ended.rc:1
;~ >Exit code: 1    Time: 0.436
everything will be as always nothing will change, so it does not create confusion, but to the contrary, it helps a lot in all cases

;is OK, but if error happens during Dllcall ehhh, Autoit Error (blocks\terminates execution) of the exe\script 
If (DllCall("Kernel32.dll", "long", "GetLastError"))[0] Then
    ;ect ect
EndIf
;;or
Return SetError((DllCall("Kernel32.dll", "long", "GetLastError"))[0], 0, $data)

;is always OK, even if error happens during Dllcall, Kernel32.dll not found or other
If (DllCall("Kernel32.dll", "long", "GetLastError")) Then;Improvement (Feature) Reques
    ;ect ect
EndIf
;;or
Return SetError((DllCall("Kernel32.dll", "long", "GetLastError")), 0, $data)
in poor words ($aArray) for now has no function in Autoit (always return None, if you do not use the Array access on expression), everything so simple nothing will change them, only add that the ($aArray) from None to Return firs element

if you see it as something that is confusing, it is another problem after

 

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Link to comment
Share on other sites

I see even more confusion, since Return(expression) is very common syntax. I may be deviant but I know my fingers use it at times, as if Return was a function.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

  • Moderators

DXRW4E,

Have you ever come across the expression "flogging a dead horse"? :huh:

If not, it is exactly what you are doing here - please just let it drop. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Hi Melba23, is everything is OK ;),

Have you ever come across the expression "flogging a dead horse"? :huh:

I had already figured out that

 

If not, it is exactly what you are doing here - please just let it drop. ;)

however i write all those posts because I think as if I feel that since not all do not understand very well the request

however is no longer important, it was just for info

 

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

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