Announcement

Collapse
No announcement yet.

Converting . over to _ in variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Converting . over to _ in variables

    With the software this is installing it needs to have the version number in each one of the files, so I was curious if there was a way to have setup factory look at a number & convert all the .'s in the number to _ & store it in a seperate variable.

    Example, if the version was 1.2 it would store 1_2 in a different variable. If the version was 1.2.1 it would store 1_2_1 in a different variable, etc; etc.

    Right now I am just having to enter the version number in 2 "assign value"'s at the startup section (I want to keep these 2 together because I am going to have to have someone else take of this for me since I am leaving soon, so I am trying to automate it as much as possible). Ideally I would like them to change the version in the "Design" section, but again, I need to keep these 2 variables together, or figure out a way for setup factory to figure out how to convert .'s over to _'s & the only thing that would need to be changed is the version number in the "Design" section.

    Any help would be apreciated here, thanks.

  • #2
    Re: Converting . over to _ in variables

    Yes, it's possible, but takes a little bit of coding.

    Basically what you would want to do is take the string and treat it like a delimited string with "." as the delimiters. You would then have to loop through the delimited string and concatenate each segment with the "_" character. String concatenation can be accomplished through an Assign Value action using the "+" operator to concatenate two strings, and checking the "Evaluate value as expression" checkbox.

    The actions you will need to use are:
    Count Delimited Strings
    Get Delimited String
    Assign Value
    and one of the available control structures to loop through to create the new string.

    Hope this points you in the right direction.

    Comment


    • #3
      Re: Converting . over to _ in variables

      I'm still pretty foggy on how all this works. You are going into some stuff that I do not normally work with. Let me show you what I've got, then we can go from there.

      The %ProductVer% is 1.2.1
      I need to make the %DuelersVersion% 1_2_1

      Assign Value: %ProductVer% = %DuelersVersion%
      This just sets %DuelersVersion% to whatever the %ProductVer% is.

      Label: Version Conversion
      This is for when it is time to loop, it can begin here again.

      Count Delimited Strings
      ===================
      Store result in variable: %DuelersVersionCountDel%
      Source String: %DuelersVersion%
      Delimiter: .
      I am hoping I am doing this part right. I am under the impression that the string position of where the "." delimiter will be will be stored in the %DuelersVersionCountDel% variable.

      Get Delimited String
      ================
      Store result in variable: %DuelersVersion%
      Source String: %DuelersVersion%
      Delimiter: .
      Item Index: %DuelersVersionCountDel%
      Here I am a little lost. I think that perhaps the %DuelersVersion% should not be in both places, but since I am not sure what it is I am trying to accomplish, I can't really do anything else with it.

      Assign Value
      ===========
      Variable name: %DuelersVersion%
      Value:
      I am totally lost here. I have "Evaluate as an expression" on which allows me to utilize the build functions, but I still don't know what to do.

      IF %DuelersVersion% ????????
      ========================
      I am a little lost here also. I do not know how to check to see if the "." character is still in the %DuelersVersion% variable via the build commands (for the "IF"). If it does find "." in the %DuelersVersion% variable, it will point it back to the "Version Conversion" label.

      I only have another day, maybe 2 to finish this off, so I would appreciate a speediant response. Thanks for your time either way.

      Comment


      • #4
        Re: Converting . over to _ in variables

        I have a few things to get out of the way first, but I'll whip you up something and send you an email today that should accomplish your task.

        Comment


        • #5
          Re: Converting . over to _ in variables

          I sent you an email with an attached project. Let me know if that accomplishes what you need.

          I tried sending you an email but is was returned. Send our support department an email and we'll reply with the project file. Just mention our correspondence, and I'll pass it along to them to attach, or they'll forward it to me.

          Comment


          • #6
            Re: Converting . over to _ in variables

            emails will not get through without a *** somewhere in the subject. I have a mail filter for blocking spam mail because I get a spam mail every 3 hours or so.

            Comment


            • #7
              Re: Converting . over to _ in variables

              Just to let you know, I tried with the *** in the subject line, but it was still returned, so email [email protected] and we'll reply to that email.

              Comment


              • #8
                Re: Converting . over to _ in variables

                My email is [email protected]

                I am not sure what email you guys have (I do have a few), but that is the correct one. Indigorose.com is now on my safe list so you should not need *** in the subject to get past my mail filter, but please do it anyways just to be on the safe side. Thanks.

                Comment

                Working...
                X