Raised This Month: $ Target: $400
 0% 

A switch item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-20-2022 , 18:09   Re: A switch item
Reply With Quote #1

Simply use a counter to keep track of which one you're currently on.

PHP Code:
szItems[][] = {"Item1""Item2""Item3"}

// Call this when you want to change the item
iItemIndex = ++iItemIndex sizeof szItems

// To get the current item string use this
szItems[iItemIndex
__________________

Last edited by fysiks; 08-21-2022 at 15:08. Reason: fix typo
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode