Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have the following code that gives the error

Default parameter specifiers are not permitted

How can this be fixed?

bool listSubscribe(string apikey,
                   string id, 
                   string email_address,
                   string [] merge_vars,
                   string email_type="html",
                   bool double_optin=false,
                   bool replace_interests=true,
                   bool send_welcome=false);

bool listUnsubscribe(string apikey, 
                     string id, 
                     string email_address, 
                     bool delete_menber=false,
                     bool send_goodbye=true,
                     bool send_notify=true);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
341 views
Welcome To Ask or Share your Answers For Others

1 Answer

As per your error message, you can't do that in v3.5.

The work around is multiple constructors:

bool listUnsubscribe(string apikey, 
                     string id, 
                     string email_address) {
  return listUnsubscribe(apikey, id, email_address, false, true, true);
}

bool listUnsubscribe(string apikey, 
                     string id, 
                     string email_address, 
                     bool delete_menber,
                     bool send_goodbye,
                     bool send_notify) {
  return whatever;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...