Jump to content

Putting a variable in function name


Recommended Posts

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

Link to comment
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
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...