• Welcome back Guest!

    MARSH is a private reefing group. Comments and suggestions are encouraged, but please keep them positive and constructive. Negative threads, posts, or attacks will be removed from view and reviewed by the staff. Continually disruptive, argumentative, or flagrant rule breakers may be suspended or banned.

Java skills? (1 Viewer)

Users who are viewing this thread

OP
OP
J

Jaybird

Guest
Joined
Jun 12, 2012
Messages
279
Reaction score
0
Location
Cypress
Not java but I program in a few languages. What do you need?

I'm looking for some script that will allow me to be able to click a button that will change the content. So on my website in my sig, to the right of my live stream I want to put small amounts of information of what I have in my tank. Similarity to what is there now. I'm using rapid weaver so its doing 90% of the work for me. Rapid weaver has a sidebar section which is what i am using to input content. I know some script I just don't know enough to make what I want. You catching my drift?

I thought I could use math to formulate a solution where z= content A and if you press a button then z=content B and so forth. But it has been some time since I had to think about x+y=z. I also didnt know the function that would cause X or Y to sift one number up or down. I then thought I could use an array but really its the same thing.

So I'm stuck at square one.
 

DustinB

Guest
Joined
Jun 2, 2010
Messages
874
Reaction score
0
Location
Santa Fe
Can you post your script so I can see what, where, and how you're trying to display the information?

As for switching via a button, I would just have the button execute a simple script. Something like this:


Code:
//At the initialization of you script create this global variable
boolean bButtonSwitch = 0;


//Call this function at the initialization of your script after the creation and initialization of the bButtonSwitch variable
void DisplayData () {
    if (bButtonSwitch) {
        // Enter your first display code here
    }
    else {
        // Enter your second display code here
    }
}

//Call This function from the click of the button
void SwitchButtonValue () {
    bButtonSwitch = !bButtonSwitch;
    DisplayData();
}

I would probably also call separate functions in the DisplayData function, one for each of the display options. I would imagine you are using some sort of display box/area to show the information? You may have to clear the information in that display box and write the new data into it when the 2 data functions are called. The only "web" programming I've really done was php, but I used to do a lot of game scripting/programming that was very similar to php. Its all really very similar in the object oriented languages.
 
Last edited:
Top