Sign in to follow this  
Followers 0
dm22

how to store two number into array.

2 posts in this topic

i wanted to store two numbers into one variable, i've been trying different ways, but they all seem to give me an error.

$slot represents the number the user will input

and the script will give me a x and y coordinates based on what the $slot is.

the x and y coords need to be stored into one variable.

$slot = InputBox("give me a number ", "any number will do" , "77")

Switch $slot
   Case 77
 $posi = [0, 0]
   Case 98
 $posi = [30, 30]
   Case 49
 $posi = [60, 60]
   Case 64
 $posi = [90, 90]
   Case Else
 $posi = [120, 120]
EndSwitch
   
MsgBox(1, "Position", "the x and y positions are " & $posi[0] & $posi[1] )

Share this post


Link to post
Share on other sites



Try this:
 

Global $posi[2]
$slot = InputBox("give me a number ", "any number will do" , "77")

Switch $slot
   Case 77
 $posi[0] = 0
 $posi[1] = 0
   Case 98
 $posi[0] = 30
 $posi[1] = 30
   Case 49
 $posi[0] = 60
 $posi[1] = 60
   Case 64
 $posi[0] = 90
 $posi[1] = 90
   Case Else
 $posi[0] = 120
 $posi[1] = 120
EndSwitch

MsgBox(1, "Position", "the x and y positions are " & $posi[0] & "," & $posi[1] )

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
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
Sign in to follow this  
Followers 0