Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Documentation question on CsScript. Get List<>, collections.
#3
Great - that works :-).

What if I wanted to return an array of a type that wasn't string?

Code:
Copy      Help
public class QMBodyField
    {
        public string fieldName { get; set; }
        public string defaultText { get; set; }
        public string text { get; set; }
    }
public class QMResults
    {
        public QMBodyField[] bodyItems { get; set; }
        public string impressionFieldName { get; set; }
        public string[] recommendationItems { get; set; }
    }

This will work fine for an array of strings:

Code:
Copy      Help
ARRAY(str) recommendationItems = results.recommendationItems
out F"n recommendationItems = {recommendationItems.len}"
for(_i 0 recommendationItems.len)
,out F"{_i} {recommendationItems[_i]}"

but I don't see how to index into the elements of bodyItems (something like bodyItems [0].fieldname?)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)