• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

1.11.12 The class PlAtom - Supporting Prolog constants
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • A C++ interface to SWI-Prolog
        • A C++ interface to SWI-Prolog
          • Overview of accessing and changing values
            • The class PlAtom - Supporting Prolog constants
              • Direct comparision to char *
              • Direct comparision to PlAtom
              • Extraction of the atom and comparison to PlAtom
              • Extraction of the atom and comparison to char *

1.11.12.1 Direct comparision to char *

Example:

PREDICATE(test, 1)
{ if ( A1 == "read" )
    ...;
}

This writes easily and is the preferred method is performance is not critical and only a few comparisons have to be made. It validates A1 to be a term-reference representing text (atom, string, integer or float) extracts the represented text and uses strcmp() to match the strings.

ClioPatria (version V3.1.1-51-ga0b30a5)