‏إظهار الرسائل ذات التسميات parameter. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات parameter. إظهار كافة الرسائل

الثلاثاء، 24 ديسمبر 2013

C++ Multiple Parameter Object creation

I am a virtual beginner in programming and am trying to understand a simple part of Object oriented programming. I apologize in advance if the answer to my question seems obvious, but I have tried to find similar examples online using google and youtube but sadly nothing fits the bill. With that said here is my question.

I am trying to make a simple video game inventory similar to the ones you would see in RPGs such as Final Fantasy VI or Chrono Trigger. What I am having trouble with is creating the items of the inventory. What I'd like help with is how to create one object that defines one item, for example a potion. I know it will take multiple parameters which are listed here:

itemText = "Potion";itemDesc = "Regain 50 HP";itemEffect = playerHP + 50;buyCost = 50;sellCost = 25;

What I'd like help with is syntax of the connection of these parameters in one object. Later I will use the data so that I can create an array that shows only the itemText and a Quantity for the player to see. Any and all help or places would be appreciated.

Thank you in advance, Delita


View the original article here

Understanding Cmdlet positional parameter

All, Forgive me I am a newbie for the Power Shell, Currently I was reading book Windows PowerShell CookBook try to get start with it. So far, Everything make sense to me except one thing, I was totally confused with the Positional Parameter to Cmdlet.

For example: Select-String

The syntax is following :

Select-String [-Pattern] [-Path] [-AllMatches] [-CaseSensitive] [-Context ][-Encoding ] [-Exclude ] [-Include ] [-List] [-NotMatch] [-Quiet] [-SimpleMatch][]Select-String [-Pattern] [-AllMatches] [-CaseSensitive] [-Context ] [-Encoding ][-Exclude ] [-Include ] [-List] [-NotMatch] [-Quiet] [-SimpleMatch] -InputObject []Select-String [-Pattern] [-AllMatches] [-CaseSensitive] [-Context ] [-Encoding ][-Exclude ] [-Include ] [-List] [-NotMatch] [-Quiet] [-SimpleMatch] -LiteralPath []

I can pass the parameter value to the Cmdlet directly by ignoring the parameter name . like below:

"Hello World"|Select-String .

Based on the concept of Positional parameter,Because the parameter -Pattern is the first parameter. the value . can match the parameter -Pattern. It is ok for me to understand.

But When I try this command line "hello world" | Select-String -AllMatches . the value . is not in the first. Why the Select-String can know it and work out the result ? Could someone please tell me more to better understand it ? thanks.


View the original article here