!Stack: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Reverted edits by RuthMartin to last version by Zinthose)
(minor updates)
Line 184: Line 184:
          
          
         This command will Read a value from the stack named "stackName".  The read value will be defined as "gflag".  If "gflag" allready exists then it will be replaced without errors.
         This command will Read a value from the stack named "stackName".  The read value will be defined as "gflag".  If "gflag" allready exists then it will be replaced without errors.
         This command is similar to the !Pop command but dose not remove the value from the stack. Also if the stack is empty !Peek will return "!EMPTY" as it's value.
         This command is similar to the !Pop command but dose not remove the valu ... \n
       
      Example:
      --------
        ${!Push} ExampleStack "5"
        ${!Peek} ExampleStack MyValue
        !Echo "${MyValue}"
        ;!echo: 5
       
        ${!Pop}  ExampleStack MyValue
        !Echo "${MyValue}"
        ;!echo: 5
       
        ${!Peek} ExampleStack MyValue
        !Echo "${MyValue}"
        ;!echo: !EMPTY
       
########################################### */
        !define !Peek `!insertmacro _!Peek`
        !macro _!Peek _StackName _RetDef
            !verbose push
            !verbose 2
            !ifdef `${_RetDef}`
                !ifdef !Stack_AllowRedefine
                    !undef `${_RetDef}`
                !else
                    !error `Previously Defined: ${_RetDef}$\nEnable the "!Stack_AllowRedefine" flag to ignore this error.`
                !endif
            !endif
            !ifndef `_Stack_${_StackName}`
                !error `Requested stack dosn't exist: StackName=${_StackName}`
            !else if `${_Stack_${_StackName}}` == ``
                !warning `Stack is Empty: ${_StackName}`
                !define `${_RetDef}` `!EMPTY`
            !else
                !ifdef _tmp_Stack
                    !undef _tmp_Stack
                !endif
                !searchparse /noerrors `${_Stack_${_StackName}}` "" `${_RetDef}` `${!Stack_Delimiter}` _tmp_Stack
            !endif
            !verbose pop
            ;!warning `STACK= ${_Stack_${_StackName}}`
        !macroend


/*#### !Exch ##############################
== The Way of the Peaceful Parent ==


      Usage:
The Way is only learned by walking it. Here are the steps I recommend:* Greet your child each morning with a smile, a hug, a loving Good Morning! This is how we would all like to be greeted each day.
      ------
        ${!Exch} stackName gflag|stack_index[1 To 13]
       
        When a number parameter is provided, !Exch will swap the item on the top of the stack with the item that is specified by the offset from the top of the stack in the parameter.
        The provided stack_index value must range from 1 to 13.  If there are not enough items on the stack to accomplish the exchange, a compiler error will occur (to help you debug your code :).
        When a gflag name is provided, !Exch will exchanges the top element of the stack with the gflag's value.
       
      Example:
      --------
        ${!Push} ExampleStack "World"
        ${!Push} ExampleStack "Hello"
       
        ## Stack is now: Hello,World
       
        ${!Exch} ExampleStack 1 ; Swap Top two stack elements
       
        ## Stack is now: World,Hello
       
        !define MyValue "NSIS"
        ${!Exch} ExampleStack MyValue
       
        ## Stack is now: NSIS,Hello
        ## ${MyValue} = "World"
       
########################################### */
        !define !Exch `!insertmacro _!Exch`
        !macro _!Exch _StackName _RetDef
            !verbose push
            !verbose 2
               
            ## Validate Stack
                !ifndef `_Stack_${_StackName}`
                    !error `Requested stack dosn't exist: StackName=${_StackName}`
                !else if `${_Stack_${_StackName}}` == ``
                    !error `Stack is Empty: StackName=${_StackName}`
                !else if `${_Stack_${_StackName}_Size}` < 0
                    !error `Not enough stack elements to handle request: !Exch ${_RetDef}$\nStack Name=${_StackName}$\nStack Size=${_Stack_${_StackName}_Size}+1`
                !else if `${_RetDef}` > 0
                    ## Index Value Provided
                    !if `${_RetDef}` > `${_Stack_${_StackName}_Size}`
                        !error `Not enough stack elements to handle request: !Exch ${_RetDef}$\nStack Name=${_StackName}$\nStack Size=${_Stack_${_StackName}_Size}+1`
                    !endif
                !endif
           
            ## CleanUp (Just in case)
                !ifdef _tmp_Stack_Exch00
                    !undef _tmp_Stack_Exch00
                !endif
                !ifdef _tmp_Stack_Exch01
                    !undef _tmp_Stack_Exch01
                !endif
                !ifdef _tmp_Stack_Exch02
                    !undef _tmp_Stack_Exch02
                !endif
                !ifdef _tmp_Stack_Exch03
                    !undef _tmp_Stack_Exch03
                !endif
                !ifdef _tmp_Stack_Exch04
                    !undef _tmp_Stack_Exch04
                !endif
                !ifdef _tmp_Stack_Exch05
                    !undef _tmp_Stack_Exch05
                !endif
                !ifdef _tmp_Stack_Exch06
                    !undef _tmp_Stack_Exch06
                !endif
                !ifdef _tmp_Stack_Exch07
                    !undef _tmp_Stack_Exch07
                !endif
                !ifdef _tmp_Stack_Exch08
                    !undef _tmp_Stack_Exch08
                !endif
                !ifdef _tmp_Stack_Exch09
                    !undef _tmp_Stack_Exch09
                !endif
                !ifdef _tmp_Stack_Exch10
                    !undef _tmp_Stack_Exch10
                !endif
                !ifdef _tmp_Stack_Exch11
                    !undef _tmp_Stack_Exch11
                !endif
                !ifdef _tmp_Stack_Exch12
                    !undef _tmp_Stack_Exch12
                !endif
                !ifdef _tmp_Stack_Exch13
                    !undef _tmp_Stack_Exch13
                !endif
                !ifdef _tmp_Stack_Exch14
                    !undef _tmp_Stack_Exch14
                !endif     
 
            ## Same as Exch
                !if `${_RetDef}` == ``
                    !undef _RetDef
                    !define _RetDef 1
                !endif
           
            ## Index Provided
                !if `${_RetDef}` > 0
               
                ## No support for exchange indexes greater than 13
                    !if `${_RetDef}` > 13
                        !error `Exchanging stack by index > 13 is not yet implemented`
               
                ## Same as Exch
                    !else if `${_RetDef}` == 1
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02
                       
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch02}`
                       
                ## Same as Exch 2
                    !else if `${_RetDef}` == 2
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch03}`
                       
                ## Same as Exch 3
                    !else if `${_RetDef}` == 3
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch04}`
                       
                ## Same as Exch 4
                    !else if `${_RetDef}` == 4
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch05}`


                ## Same as Exch 5
[[http://goodvillenews.com/The-Way-of-the-Peaceful-Parent-sdV8KN.html The Way of the Peaceful Parent]]
                    !else if `${_RetDef}` == 5
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch06}`


                ## Same as Exch 6
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
                    !else if `${_RetDef}` == 6
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch07}`


                ## Same as Exch 7
== Pilgrims for Peace: One Couples Incredible Journey ==
                    !else if `${_RetDef}` == 7
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07 `${!Stack_Delimiter}` _tmp_Stack_Exch08
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch07}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch08}`
                   
                ## Same as Exch 8
                    !else if `${_RetDef}` == 8
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07 `${!Stack_Delimiter}` _tmp_Stack_Exch08 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch09
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch08}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch07}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch09}`
                   
                ## Same as Exch 9
                    !else if `${_RetDef}` == 9
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07 `${!Stack_Delimiter}` _tmp_Stack_Exch08 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch09 `${!Stack_Delimiter}` _tmp_Stack_Exch10
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch09}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch07}${!Stack_Delimiter}${_tmp_Stack_Exch08}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch10}`


                ## Same as Exch 10
"In the life of each and every one of us, there is a defining moment, one after which we know that our lives will never be the same. For me, 9/11 was that moment." Mony Dojeijis defining moment eventually led her to an ancient pilgrimage route in Spain, where a chance encounter with an artist would change both of their lives forever. Together they would end up walking a pilgrimage for peace in Jerusalem -- and in the process would uncover precious insights about themselves, each other and the goodness of humanity.
                    !else if `${_RetDef}` == 10
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07 `${!Stack_Delimiter}` _tmp_Stack_Exch08 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch09 `${!Stack_Delimiter}` _tmp_Stack_Exch10 `${!Stack_Delimiter}` _tmp_Stack_Exch11
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch10}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch07}${!Stack_Delimiter}${_tmp_Stack_Exch08}${!Stack_Delimiter}${_tmp_Stack_Exch09}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch11}`


                ## Same as Exch 11
[[http://goodvillenews.com/Pilgrims-for-Peace-One-Couples-Incredible-Journey-FMm6R6.html Pilgrims for Peace: One Couples Incredible Journey]]
                    !else if `${_RetDef}` == 11
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07 `${!Stack_Delimiter}` _tmp_Stack_Exch08 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch09 `${!Stack_Delimiter}` _tmp_Stack_Exch10 `${!Stack_Delimiter}` _tmp_Stack_Exch11 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch12
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch11}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch07}${!Stack_Delimiter}${_tmp_Stack_Exch08}${!Stack_Delimiter}${_tmp_Stack_Exch09}${!Stack_Delimiter}${_tmp_Stack_Exch10}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch12}`


                ## Same as Exch 12
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
                    !else if `${_RetDef}` == 12
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07 `${!Stack_Delimiter}` _tmp_Stack_Exch08 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch09 `${!Stack_Delimiter}` _tmp_Stack_Exch10 `${!Stack_Delimiter}` _tmp_Stack_Exch11 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch12 `${!Stack_Delimiter}` _tmp_Stack_Exch13
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch12}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch07}${!Stack_Delimiter}${_tmp_Stack_Exch08}${!Stack_Delimiter}${_tmp_Stack_Exch09}${!Stack_Delimiter}${_tmp_Stack_Exch10}${!Stack_Delimiter}${_tmp_Stack_Exch11}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch13}`
                           
                ## Same as Exch 13
                    !else if `${_RetDef}` == 13
                        !searchparse /noerrors `${_Stack_${_StackName}}` "" \
                            _tmp_Stack_Exch00 `${!Stack_Delimiter}` _tmp_Stack_Exch01 `${!Stack_Delimiter}` _tmp_Stack_Exch02 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch03 `${!Stack_Delimiter}` _tmp_Stack_Exch04 `${!Stack_Delimiter}` _tmp_Stack_Exch05 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch06 `${!Stack_Delimiter}` _tmp_Stack_Exch07 `${!Stack_Delimiter}` _tmp_Stack_Exch08 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch09 `${!Stack_Delimiter}` _tmp_Stack_Exch10 `${!Stack_Delimiter}` _tmp_Stack_Exch11 `${!Stack_Delimiter}` \
                            _tmp_Stack_Exch12 `${!Stack_Delimiter}` _tmp_Stack_Exch13 `${!Stack_Delimiter}` _tmp_Stack_Exch14
                           
                        !undef  `_Stack_${_StackName}`
                        !define `_Stack_${_StackName}` `${_tmp_Stack_Exch13}${!Stack_Delimiter}${_tmp_Stack_Exch01}${!Stack_Delimiter}${_tmp_Stack_Exch02}${!Stack_Delimiter}${_tmp_Stack_Exch03}${!Stack_Delimiter}${_tmp_Stack_Exch04}${!Stack_Delimiter}${_tmp_Stack_Exch05}${!Stack_Delimiter}${_tmp_Stack_Exch06}${!Stack_Delimiter}${_tmp_Stack_Exch07}${!Stack_Delimiter}${_tmp_Stack_Exch08}${!Stack_Delimiter}${_tmp_Stack_Exch09}${!Stack_Delimiter}${_tmp_Stack_Exch10}${!Stack_Delimiter}${_tmp_Stack_Exch11}${!Stack_Delimiter}${_tmp_Stack_Exch12}${!Stack_Delimiter}${_tmp_Stack_Exch00}${!Stack_Delimiter}${_tmp_Stack_Exch14}`


                ## Invalix Syntax
== 15 Life Changing Lessons to Learn from Wayne Dyer ==
                    !else
                        !error `Syntax Invalid: "${_RetDef}"`
                    !endif
                   
            ## Same as Exch $0
                !else
                    !ifdef _tmp_Stack_Exch00
                        !undef _tmp_Stack_Exch00
                    !endif
                    !define _tmp_Stack_Exch00 `${${_RetDef}}`
                    !ifndef !Stack_AllowRedefine
                        !define !Stack_AllowRedefine
                        ${!Pop} `${_StackName}` `${_RetDef}`
                        !undef !Stack_AllowRedefine
                    !endif
                    ${!Push} `${_StackName}` `${_tmp_Stack_Exch00}`
                !endif
           
            ## Clean Up
                !ifdef _tmp_Stack_Exch00
                    !undef _tmp_Stack_Exch00
                !endif
                !ifdef _tmp_Stack_Exch01
                    !undef _tmp_Stack_Exch01
                !endif
                !ifdef _tmp_Stack_Exch02
                    !undef _tmp_Stack_Exch02
                !endif
                !ifdef _tmp_Stack_Exch03
                    !undef _tmp_Stack_Exch03
                !endif
                !ifdef _tmp_Stack_Exch04
                    !undef _tmp_Stack_Exch04
                !endif
                !ifdef _tmp_Stack_Exch05
                    !undef _tmp_Stack_Exch05
                !endif
                !ifdef _tmp_Stack_Exch06
                    !undef _tmp_Stack_Exch06
                !endif
                !ifdef _tmp_Stack_Exch07
                    !undef _tmp_Stack_Exch07
                !endif
                !ifdef _tmp_Stack_Exch08
                    !undef _tmp_Stack_Exch08
                !endif
                !ifdef _tmp_Stack_Exch09
                    !undef _tmp_Stack_Exch09
                !endif
                !ifdef _tmp_Stack_Exch10
                    !undef _tmp_Stack_Exch10
                !endif
                !ifdef _tmp_Stack_Exch11
                    !undef _tmp_Stack_Exch11
                !endif
                !ifdef _tmp_Stack_Exch12
                    !undef _tmp_Stack_Exch12
                !endif
                !ifdef _tmp_Stack_Exch13
                    !undef _tmp_Stack_Exch13
                !endif
                !ifdef _tmp_Stack_Exch14
                    !undef _tmp_Stack_Exch14
                !endif
               
            !verbose pop
        !macroend


!endif # ___!Stack_NSH___
Some of the most powerful and life changing lessons I have learned so far came from this great man, Wayne Dyer and today I would like to share with you some of these lessons. The lessons are in no particular order as all of them are equally important.


!verbose pop</highlight-nsis>
[[http://goodvillenews.com/15-Life-Changing-Lessons-to-Learn-from-Wayne-Dyer-rnH16X.html 15 Life Changing Lessons to Learn from Wayne Dyer]]
[[Category:Headers|Sort.nsh]]
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
== Servant Leadership: Helping People Come Alive ==
 
"Its a powerful perspective on work -- holding within it a value for collaboration, agency, creativity, and meaning. What if we all could see what we do in that way? What if our organizations supported us in holding that perspective, and to go one step further, how can we create institutions that release these core values? In his seminal 1970 essay
 
[[http://goodvillenews.com/Servant-Leadership-Helping-People-Come-Alive-zqkEDB.html Servant Leadership: Helping People Come Alive]]
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
== Meet The New Boss: You ==
 
What do coffee growers in Ethiopia, hardware store owners in America, and Basque entrepreneurs have in common? For one thing, many of them belong to cooperatives. By pooling their money and resources, and voting democratically on how those resources will be used, they can compete in business and reinvest the benefits in their communities.
 
[[http://goodvillenews.com/Meet-The-New-Boss-You-wF4aeF.html Meet The New Boss: You]]
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]

Revision as of 10:48, 15 August 2012

About

The following is an experiment to create a pseudo stack implementation for use within a precompiler context.

Usage

Example

;!define !Stack_AllowRedefine
;!define !Stack_Delimiter ¤
!include "!Stack.nsh"
 
${!Push} TestStack 0            # Stack(TestStack): 0 
${!Push} TestStack 1            # Stack(TestStack): 1 0
${!Push} TestStack 2            # Stack(TestStack): 2 1 0
${!Push} TestStack 3            # Stack(TestStack): 3 2 1 0
${!Push} TestStack 4            # Stack(TestStack): 4 3 2 1 0
 
${!Exch} TestStack 1            # Stack(TestStack): 3 4 2 1 0
 
!define  ValueTmp 5
${!Exch} TestStack ValueTmp     # Stack(TestStack): 5 4 2 1 0
${!Push} TestStack ${ValueTmp}  # Stack(TestStack): 3 5 4 2 1 0
 
${!Exch} TestStack 2            # Stack(TestStack): 4 5 3 2 1 0
${!Exch} TestStack 1            # Stack(TestStack): 5 4 3 2 1 0
 
${!Pop}  TestStack Value5       # Stack(TestStack): 4 3 2 1 0
${!Pop}  TestStack Value4       # Stack(TestStack): 3 2 1 0
${!Peek} TestStack Value3       # Stack(TestStack): 3 2 1 0
${!Pop}  TestStack Value3       # Stack(TestStack): 2 1 0
${!Pop}  TestStack Value2       # Stack(TestStack): 1 0
${!Pop}  TestStack Value1       # Stack(TestStack): 0
${!Pop}  TestStack Value0       # Stack(TestStack): EMPTY
;${!Pop}  TestStack ValueE       # Stack(TestStack): ERROR! Stack is Empty!
 
!echo `5=${Value5}`
!echo `4=${Value4}`
!echo `3=${Value3}`
!echo `2=${Value2}`
!echo `1=${Value1}`
!echo `0=${Value0}`
;!echo `E=${ValueE}`

Source

<highlight-nsis>## !include "!Stack.nsh"

!verbose push !verbose 0

!ifndef ___!Stack_NSH___ !define ___!Stack_NSH___

/*#### PreCompiler Stack #########################################################################

   The following is a Psudo Stack implementation for use within a precompiler context.
   This may be useful when attempting to process across #includes.
   Imagine allowing a precompiler to know when a previous macro has enabled a feature ect.
   Be creative and use your imagination.  I'm sure you'll think of somethng.  ;o)
   
   FUNCTIONS:
       ${!Push}
       ${!Pop}
       ${!Peek}
       ${!Exch}
       
   FLAGS:
       !Stack_Delimiter
       !Stack_AllowRedefine
   
   As a possible guideline, I recommend using the intended library's filename.
       EXAMPLE:
           ${!Push} !Stack.nsh "Value to Store"
       
   Future Enhancments:
       * Expand the !Exch stack_index range beyond 13
           If I could implement a !For !Loop it would make this a snap!
       * Add commands:
           !Flush - Use to remove a certian number of elements from the stack
                                                                                                                                                                                                    1. */

/*#### Defines the Stack Delimiter ########

   You can change this to suite your needs.
   EXAMPLE:
    If you want to change the delimiter to a comma use...
       !define !Stack_Delimiter ,
                                                                                      1. */
       !ifndef !Stack_Delimiter
           !define !Stack_Delimiter ¤
       !endif
       

/*#### Allows for Redefinition ############

   By default, if a define previously exists then a compiler time error will occur.
   Add this flag to enable automatic redefines to prevent this error.
                                                                                      1. */
!define !Stack_AllowRedefine

/*#### !Push ##############################

      Usage:
      ------
       ${!Push} stackName value
       
       This command will Push a value onto a stack named "stackName".
       
      Example:
      --------
       ${!Push} ExampleStack "5"
       ${!Pop}  ExampleStack MyValue
       !Echo "${MyValue}"
       ;!echo: 5
      
                                                                                      1. */
       !define !Push `!insertmacro _!Push`
       !macro _!Push _StackName _Value
           !verbose push
           !verbose 2
           !ifndef `_Stack_${_StackName}`
               ## First refereance to stack
                   !define `_Stack_${_StackName}` `${_Value}${!Stack_Delimiter}`
                   !define `_Stack_${_StackName}_Size` 0
           !else
               ## Push Value onto stack
                   !define _tmp_Stack `${_Value}${!Stack_Delimiter}${_Stack_${_StackName}}`
                   !undef `_Stack_${_StackName}`
                   !define `_Stack_${_StackName}` `${_tmp_Stack}`
                   !undef _tmp_Stack
               
               ## Increment Stack Size Counter
                   !define /math _tmp_Stack `${_Stack_${_StackName}_Size}` + 1
                   !undef `_Stack_${_StackName}_Size`
                   !define `_Stack_${_StackName}_Size` `${_tmp_Stack}`
                   !undef _tmp_Stack
           !endif
           !verbose pop
           ;!warning `STACK= ${_Stack_${_StackName}}`
       !macroend
       

/*#### !Pop ###############################

      Usage:
      ------
       ${!Pop} stackName gflag
       
       This command will Pop a value from the stack named "stackName".  The popped value will be defined as "gflag".  If "gflag" allready exists then it will be replaced without errors.
       
      Example:
      --------
       ${!Push} ExampleStack "5"
       ${!Pop}  ExampleStack MyValue
       !Echo "${MyValue}"
       ;!echo: 5
       
                                                                                      1. */
       !define !Pop `!insertmacro _!Pop`
       !macro _!Pop _StackName _RetDef
           !verbose push
           !verbose 2
           
           !ifndef `_Stack_${_StackName}`
               !error `Requested stack dosn't exist: StackName=${_StackName}`
           !else if `${_Stack_${_StackName}}` == ``
               !error `Stack is Empty: StackName=${_StackName}`
           !else if `${_Stack_${_StackName}_Size}` < 0
               !error `Not enough stack elements to handle request: !Pop ${_RetDef}$\nStack Name=${_StackName}$\nStack Size=${_Stack_${_StackName}_Size}+1`
           !endif
           
           ${!Peek} `${_StackName}` `${_RetDef}`
           
           !undef `_Stack_${_StackName}`
           !define `_Stack_${_StackName}` `${_tmp_Stack}`
           !undef _tmp_Stack
           ## Decrement Stack Size Counter
               !define /math _tmp_Stack `${_Stack_${_StackName}_Size}` - 1
               !undef `_Stack_${_StackName}_Size`
               !define `_Stack_${_StackName}_Size` `${_tmp_Stack}`
               !undef _tmp_Stack
           !verbose pop
           ;!warning `STACK= ${_Stack_${_StackName}}`
       !macroend
   

/*#### !Peek ##############################

      Usage:
      ------
       ${!Peek} stackName gflag
       
       This command will Read a value from the stack named "stackName".  The read value will be defined as "gflag".  If "gflag" allready exists then it will be replaced without errors.
       This command is similar to the !Pop command but dose not remove the valu ... \n

The Way of the Peaceful Parent

The Way is only learned by walking it. Here are the steps I recommend:* Greet your child each morning with a smile, a hug, a loving Good Morning! This is how we would all like to be greeted each day.

[The Way of the Peaceful Parent]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Pilgrims for Peace: One Couples Incredible Journey

"In the life of each and every one of us, there is a defining moment, one after which we know that our lives will never be the same. For me, 9/11 was that moment." Mony Dojeijis defining moment eventually led her to an ancient pilgrimage route in Spain, where a chance encounter with an artist would change both of their lives forever. Together they would end up walking a pilgrimage for peace in Jerusalem -- and in the process would uncover precious insights about themselves, each other and the goodness of humanity.

[Pilgrims for Peace: One Couples Incredible Journey]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

15 Life Changing Lessons to Learn from Wayne Dyer

Some of the most powerful and life changing lessons I have learned so far came from this great man, Wayne Dyer and today I would like to share with you some of these lessons. The lessons are in no particular order as all of them are equally important.

[15 Life Changing Lessons to Learn from Wayne Dyer]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Servant Leadership: Helping People Come Alive

"Its a powerful perspective on work -- holding within it a value for collaboration, agency, creativity, and meaning. What if we all could see what we do in that way? What if our organizations supported us in holding that perspective, and to go one step further, how can we create institutions that release these core values? In his seminal 1970 essay 
[Servant Leadership: Helping People Come Alive]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]

Meet The New Boss: You

What do coffee growers in Ethiopia, hardware store owners in America, and Basque entrepreneurs have in common? For one thing, many of them belong to cooperatives. By pooling their money and resources, and voting democratically on how those resources will be used, they can compete in business and reinvest the benefits in their communities.

[Meet The New Boss: You]

[GoodvilleNews.com - good, positive news, inspirational stories, articles]