pbody2012

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

115 Neutral

About pbody2012

  • Rank
    Newbie
  1. How to pass array<string>& to a function?

    I kept getting compiler errors so i decided to toss the code and use a workaround.
  2. How to pass array<string>& to a function?

    Ok I found out that I forget to register the array types, so I did that.  The function is compiling, however I cant it.   I have the following code that I call the function from:   array<string> gEngineRPMUnits = { "stall-rpm","start-rpm","idle-rpm","redline-rpm","max-rpm" }; string VerifyEngineUnitSpec( string attribute, string unitSpec ) { // local // string result; // check for rpm if( stringInList(gEngineRPMUnits,attribute) ) { // unit has to be rpm, rps, rad/s if( unitSpec!="revolution" ) return "error"; else return unitSpec; } return ""; }   Is this valid?
  3. How to pass array<string>& to a function?

    Ok I will give it a try and let you know what happened.
  4. How to pass array<string>& to a function?

    I am also not using the repository version.  I'd rather not until the next release.
  5. How to pass array<string>& to a function?

    I'm using version 2.26 I am not using any non default options, I have not touched these at all. I am using a namespace but it is for another piece of code. This code is in a separate file and it is being included in another file.
  6. Just as the title says, how do i pass array<string>& to a function?   I have this function defined in anglescript and I have other script functions calling it.  However, it is failing to compile with this message: unit-spec.as (5,25) : ERR : Expeted ">" or ","   bool stringInList( array<string>& arg, string s ) { for( uint n = 0; n < arg.length(); n++ ) { if( arg[n] == s ) return true; } return false; }     
  7. Functions with default parameters

    thnx
  8. Functions with default parameters

    It is possible to register functions with defaults arguments and call them from the script.
  9. The dictionary class

    Is it possible to have the dictionary in angelscript with a different syntax?  The reason for this question is because I was originally going to use Lua in a project that I am working on, because I love its design in regards to its tables.  They can be used as a means of doing configurations, but binding to a lua vm and then performing operations are mind boggling.  Binding c++ to angelscript is what really won me over because it is pretty straightforward.  Also because there is no vm to worry about because it just makes native calls.   However, I would like to also use angelscript as a configuration language if possible.  Can there be lua like tables or something close to it ( the dictionary with some syntax sugar ).   dict = { ("one",1), ("object",object), ("handle",@handle) };   or   dict.set( ("one",1), ("object",object), ("handle",@handle) );   or   something