0

I am trying to build a complex string to insert a new formulae on the fly in google script. In VBA you use chr(34), is there a similar work around in google script?

Thanks

1 Answer 1

1

From this thread "Some common VBA functions translated to Google Apps Script" you will find here in Slide 6 that the function Chr(n) in VBA is translated in the javascript:

 function Chr(n) {
  return String.fromCharCode(n);
}

You can also find it in this Github.

For the sample code on how to use this function in AppsScript, check this link.

var map = Maps.newStaticMap();
 for (var i = 0; i < route.legs.length; i++) {
   var leg = route.legs[i];
   if (i == 0) {
     // Add a marker for the start location of the first leg only.
     map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode));
     map.addMarker(leg.start_location.lat, leg.start_location.lng);
     markerLetterCode++;
   }
   map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode));
   map.addMarker(leg.end_location.lat, leg.end_location.lng);
   markerLetterCode++;
 }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.