Little suggestion here.



  • I’m learning PHP right now, and I found out that the if and elseif behaviors are similar to those in PHP, and after the lesson about if and elseif, I have discovered Switch.

    I’m pretty sure that some of us know what Switch is, but for those who don’t know:
    As I understand already, it takes one value first and sort out and array to find if one value matches with the first value and then it executes the rest of the program. Correct me if I’m wrong, please.

    But it would be really helpful if it comes to hyperPad! I don’t know if it has already been suggested in the past, but I’m suggesting it now :)



  • @XxWhiteHearrxX I’m not an expert but a switch statement traditionally is just meant to be a way to compare a variable to multiple values and have a specific case for each value. This should be functionally identical to a list of if/else if/else, though I guess it’s meant to be simpler/cleaner.

    Could maybe be interesting if it was a behaviour that lets you simplify a ton of if/else ifs into a single behaviour that just runs the nth behaviour underneath, kinda like how execute sequence runs a specific behaviour each time.

    It could have a UI like an array, where the indexes correspond to the behaviour number connected underneath and the value is the value to check for. I don’t know if there are enough uses for it to be worth adding though.



  • @Jack8680 I really think it would be worth it, because I think I saw posts, really back in the days, users saying that working around with a ton of If behaviors is kind of messy where you just want to check for one results out of several If behaviors ( if I remember correctly ^^' ). It could help when you want to put a Skin System for example. Maybe it could even bring a lot of new possibility, but I won't exagerate, because still: I didn't even try the Switch thing on PHP, I'm just learning ( but it still amaze me ). But having a new Behavior that could Simplify If Behaviors, that could help 😊



  • There is a website perfect for beginners, this website shows all syntax and how to use commands in code.


Log in to reply