Sign in to follow this  
Followers 0
DeFirence

Putting a variable in function name

6 posts in this topic

Hi all,

Im trying to put a varible in a function name.

Ive tried both of the following:

KickSlot&$SlotNumber()

KickSlot&$SlotNumber&()

Please help me out,

Thanks alot

DeF

Share this post


Link to post
Share on other sites



Why?

Im trying to put a varible in a function name.


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

look at Assign() and Eval()


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Why?

Func CheckAllSlots()

$SlotNumber = 0

Do

$SlotNumber = $SlotNumber + 1

CheckSlotAgainstPlayer()

Until $SlotNumber = 10

EndFunc

Func CheckSlotAgainstPlayer()

CheckSlot()

$PlayerName = ClipGet()

Read_Player_List()

If $PlayerName <> $AnyPlayers Then

KickSlot&$SlotNumber&()

Else

EndIf

EndFunc

Share this post


Link to post
Share on other sites

Why not just pass the $slotnumber to the KickSlot() function by defining it and calling it as: func KickSlot($slotnumber) and KickSlot($slotnumber)?

Func CheckAllSlots()

$SlotNumber = 0

Do

$SlotNumber = $SlotNumber + 1

CheckSlotAgainstPlayer()

Until $SlotNumber = 10

EndFunc

Func CheckSlotAgainstPlayer()

CheckSlot()

$PlayerName = ClipGet()

Read_Player_List()

If $PlayerName <> $AnyPlayers Then

KickSlot&$SlotNumber&()

Else

EndIf

EndFunc


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

look at Assign() and Eval()

Thanks :)

Execute works great

DeF

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