2016-08-16 51 views

回答

1

从这个线程“Some common VBA functions translated to Google Apps Script”,你会发现这里的幻灯片6,在VBA的function Chr(n)在JavaScript翻译:

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

你也可以找到它在这个Github

有关如何在AppsScript中使用此功能的示例代码,请检查此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++; 
} 
相关问题