Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Comments & Feedback
  3. Little suggestion here.

Little suggestion here.

Scheduled Pinned Locked Moved Comments & Feedback
4 Posts 3 Posters 783 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MelideM Offline
    MelideM Offline
    Melide
    wrote on last edited by
    #1

    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 :)

    Jack de WildeJ 1 Reply Last reply
    1
    • MelideM Melide

      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 :)

      Jack de WildeJ Offline
      Jack de WildeJ Offline
      Jack de Wilde
      wrote on last edited by
      #2

      @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.

      MelideM 1 Reply Last reply
      2
      • Jack de WildeJ Jack de Wilde

        @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.

        MelideM Offline
        MelideM Offline
        Melide
        wrote on last edited by
        #3

        @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 😊

        1 Reply Last reply
        2
        • RobinsonXR Offline
          RobinsonXR Offline
          RobinsonX
          wrote on last edited by
          #4

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

          https://www.w3schools.com/php/php_switch.asp

          1 Reply Last reply
          1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Search