• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
        • Localhost Action Invoker Namespace
        • Localhost.mapActionResult Action
        • Localhost.mapFile Action
        • Localhost.mapSymbol Action
        • Localhost.mapText Action
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Localhost.mapText Action

Format
s = CS.Localhost.mapText(text := ...ʃ, contentType := ...ʅ)
ArgumentDescriptionTypes / Required
textThe text to map.string
required
contentTypeThe MIME type of the mapped content.
The default value is "text/plain".
string
not required
Description
The Localhost.mapText action creates a localhost URL that provides access to the text when accessed from a local web server. The text is mapped in its UTF-8 representation.
By specifying contentType, you can override how the local web server defines the Content-Type header when serving the text content. For example, if the text is HTML content, you would set contentType to "text/html".
Return Value
The action returns a string containing the localhost URL that can be used to access the text. The URL is valid as long as the CSPro application is running.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form.
Example (CSPro Logic)
// create a simple text report displaying the date/time in a variety
// of formats and display it in the embedded web browser
string dateReport = "Date Report\n" +
                   
"-----------\n" +
                   
maketext("\nsysdate: %d", sysdate("YYYYMMDD")) +
                   
maketext("\nsystime: %d", systime()) +
                   
maketext("\ntimestamp: %d", timestamp()) +
                   
maketext("\ntimestring: %s", timestring());

string url = CS.Localhost.mapText(text := dateReport);
view(url);
See also: Localhost Action Invoker Namespace, Localhost URL