• <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
        • Application Action Invoker Namespace
        • Application.getFormFile Action
        • Application.getQuestionnaireContent Action
        • Application.getQuestionText Action
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • 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>

Application.getQuestionText Action

Format
s = CS.Application.getQuestionText(ʃname := ... ‖ path := ...ʅ)
ArgumentDescriptionTypes / Required
nameThe name of an application.string
not required
pathThe path of a question text file to read.string
not required
Description
The Application.getQuestionText action returns the question text associated with an application or loaded from the disk. One, and only one, of the arguments name or path must be provided.
If specifying name, you can also specify the name of a form file or a dictionary. When using a form file or dictionary, the question text associated with that entity's application is returned.
If neither name nor path are specified, the application's question text is returned.
Return Value
The action returns the question text.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form, or if:
  • No application, or associated form file or dictionary, exists with the specified name.
  • The name identifies an application that does not have question text.
  • The question text file does not exist or cannot be read.
Example (JavaScript)
// write to the console the name of all entities with question text
const questionText = CS.Application.getQuestionText({
    path: 
"Census Data Entry.ent.qsf"
});

questionText.questions.forEach(question => {
    console.log(question.name);
});
Example (CSPro Logic)
// construct the input needed for the questionnaire view, using the external dictionary
// attached to this application but getting the forms and question text from the disk
string questionnaireViewInput =
   
maketext("{ \"dictionary\": %s, \"forms\": %s, \"questionText\": %s, \"case\": %s }",
             
CS.Dictionary.getDictionary(name := "MARINE_DICT"),
             
CS.Application.getFormFile(path := "Marine Mammals Survey.fmf"),
             
CS.Application.getQuestionText(path := "Marine Mammals Survey.ent.qsf"),
             
CS.Data.getCase(name := "MARINE_DICT"));

// pass this input to the questionnaire view
CS.UI.view(path := Path.concat(html, "questionnaire-view", "index.html"),
           
inputData := @object questionnaireViewInput);
See also: Application Action Invoker Namespace, Application.getQuestionnaireContent Action