Jump to content

Are multiple values possible?


KillaX
 Share

Recommended Posts

Is it possible to use $Slot1 = "91919","Red.jpg" and be able to access only a certain value from it? If not.. Is there a command that acts like this? Just looking for a way to shorten my code up. be even more help full if i could do $Row1 = value1,value2,value3,...,value8

Link to comment
Share on other sites

Is it possible to use $Slot1 = "91919","Red.jpg" and be able to access only a certain value from it? If not.. Is there a command that acts like this? Just looking for a way to shorten my code up. be even more help full if i could do $Row1 = value1,value2,value3,...,value8

It's called an array. Each element stored in it has a number (index).

#include <array.au3> ; just for _ArrayDisplay()

Global $Row1 = StringSplit("value1,value2,value3", ",")
_ArrayDisplay($Row1, "Debug: $Row1")
MsgBox(64, "$Row1[2]", "$Row1[2] = " & $Row1[2])

:D

P.S. Confound those WeaponX bots, they're too fast!

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

Dim $array[2] = ["91919","Red.jpg"]

ConsoleWrite($array[0]) <--- "91919"

ConsoleWrite($array[1]) <--- "Red.jpg"

Thanks, I'll try giving that a shot. my other thing I wanted to know about autoit, Can you ever put 2 things on 1 line? like an example with HTML:

<h1>Thing1</h1><h1>thing2</h1> HTML can be used on 1 solid line, but is that possible with autoit? Like what you showed me, array 0 and 1, can that be 1 line?

NVM!! I posted this when PsaltyDS didn't post yet!

Edited by KillaX
Link to comment
Share on other sites

Thanks, I'll try giving that a shot. my other thing I wanted to know about autoit, Can you ever put 2 things on 1 line? like an example with HTML:

<h1>Thing1</h1><h1>thing2</h1> HTML can be used on 1 solid line, but is that possible with autoit? Like what you showed me, array 0 and 1, can that be 1 line?

NVM!! I posted this when PsaltyDS didn't post yet!

If you mean can you put more than one statement on one line, like you can in C then no.

Eg in C, C++ you can say

Ab = 5; Ac = 6;

but in AutoIt you must write

$Ab = 5

$Ac = 6

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

If you mean can you put more than one statement on one line, like you can in C then no.

Eg in C, C++ you can say

Ab = 5; Ac = 6;

but in AutoIt you must write

$Ab = 5

$Ac = 6

Can't you go $a = 1, $b = 2, $c = 3??
Link to comment
Share on other sites

Can't you go $a = 1, $b = 2, $c = 3??

Yes, but only for variable declaration following the keywords DIM, LOCAL, or GLOBAL.

:D

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

Yes, but only for variable declaration following the keywords DIM, LOCAL, or GLOBAL.

:D

..and Const, and Redim. 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

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