MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "ReadRecords_(Dataset_function)",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "5013": {
                "pageid": 5013,
                "ns": 0,
                "title": "ReadBlock (Dataset function)",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "{{Template:Dataset:ReadBlock subtitle}}\n\nThis function reads a block of data from an input <var>Dataset</var>.\n==Syntax==\n{{Template:Dataset:ReadBlock syntax}}\n===Syntax terms===\n<table class=\"syntaxTable\">\n<tr><th>%string</th>\n<td>A [[Longstrings|longstring]] variable (though for small blocks, a regular string variable might suffice) to receive the block of data.\n</td></tr>\n<tr><th>dataset</th>\n<td>A reference to an instance of a <var>Dataset</var> object.\n \n</td></tr></table>\n==Usage notes==\n<ul>\n<li>The <var>Dataset</var> object must be an input object, that is, its\n<var>[[Output (Dataset property)|Output]]</var> property must be <var>False</var>, to use the <var>ReadBlock</var> method.\nUsing <var>ReadBlock</var> against an output dataset results in request cancellation.\n\n<li>The <var>Dataset</var> object must be in the <var>Open</var> [[Dataset class#The DatasetState enumeration|state]] to use the <var>ReadBlock</var> method.\nUsing <var>ReadBlock</var> against a <var>Dataset</var> in the <var>Closed</var> or <var>AfterEnd</var> state\nresults in request cancellation.\n\n<li>If a <var>ReadBlock</var> method is used after a <var>[[ReadRecord (Dataset function)|ReadRecord]]</var> method.\nany records in the block after the record returned by the preceding <var>ReadRecord</var> are skipped.\nAs such, it is generally not a good idea to mix <var>ReadBlock</var> and <var>ReadRecord</var>\nprocessing for a single dataset.\n\n<li>For F or FB files, the string returned by <var>ReadBlock</var> has a length that\nis an exact multiple of the <var>[[RecordLength (Dataset property)|RecordLength]]</var> property value.\n\n<li>For V or VB files, the string returned by <var>ReadBlock</var> has a binary BDW\n(Block Descriptor Word), and the individual records will be preceded by a binary RDW (Record Descriptor Word).\nThis is true even under CMS, where records are not really stored on disks\nwith BDWs and RDWs &mdash; they are mapped to the MVS format by BSAM\nsimulation.\n\n<li>Given the difficulty of working with blocked data, especially for V and\nVB format datasets, it is generally a better idea to use <var>ReadRecord</var> than\n<var>ReadBlock</var>, and have the <var>Dataset</var> class handle the physical data formats.\n\n<li>When a <var>ReadBlock</var> reaches the end of a file, it returns a null string and\nswitches the dataset to the <var>AfterEnd</var> state.\nAfter this, a <var>ReadRecord</var> or <var>ReadBlock</var> results in request cancellation.\n<var>ReadBlock</var> will never return a null string except at end of file.\n</ul>\n\n==See also==\n{{Template:Dataset:ReadBlock footer}}"
                    }
                ]
            },
            "5014": {
                "pageid": 5014,
                "ns": 0,
                "title": "ReadRecord (Dataset function)",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "{{Template:Dataset:ReadRecord subtitle}}\n\n==Syntax==\n{{Template:Dataset:ReadRecord syntax}}\n===Syntax terms===\n<table class=\"syntaxTable\">\n<tr><th>%string</th>\n<td>A string or [[Longstrings|longstring]] variable to receive the block of data.\n</td></tr>\n<tr><th>dataset</th>\n<td>A reference to an instance of a <var>Dataset</var> object.\n \n</td></tr></table>\n==Usage notes==\n<ul>\n<li>The <var>Dataset</var> object must be an input object, that is, its\n<var>[[Output (Dataset property)|Output]]</var> property must be <var>False</var> to use the <var>ReadRecord</var> method.\nUsing <var>ReadRecord</var> against an output dataset results in request cancellation.\n\n<li>The <var>Dataset</var> object must be in the <var>Open</var> [[Dataset class#The DatasetState enumeration|state]] to use the <var>ReadRecord</var> method.\nUsing <var>ReadRecord</var> against a dataset in the <var>Closed</var> or <var>AfterEnd</var> state\nresults in request cancellation.\n\n<li>If a <var>ReadRecord</var> method is used after a <var>ReadBlock</var> method, the first record\nin the block after the block returned by the <var>ReadBlock</var> is returned.\n\n<li>For F or FB files, the string returned by <var>ReadRecord</var> has a length that\nis exactly equal to the <var>RecordLength</var>.\n\n<li>For V or VB files, the string returned by <var>ReadRecord</var> has a length less\nthan the <var>[[RecordLength (Dataset property)|RecordLength]]</var> property value.\nIt does '''not''' contain the record's RDW, that is, it only contains the\ndata portion of the record.\nAs such, a program that uses <var>ReadRecord</var> can generally be used without\nmodification (except for, perhaps, record padding issues) for different\n<var>RecordFormats</var>.\n\n<li>When a <var>ReadRecord</var> reaches the end of a file, it returns a null string and\nswitches the dataset to the <var>AfterEnd</var> state.\nAfter this, a <var>ReadRecord</var> or <var>ReadBlock</var> results in request cancellation.\nFor V or VB datasets, it is possible for <var>ReadRecord</var> to return a null record\nwhen it is not at the end of file.\nBecause of this, it is probably best to check the <var>Dataset</var>'s\n<var>[[State (Dataset property)|State]]</var> property rather than using the size of the returned\nrecord to determine if the end of file has been reached.\n</ul>\n\n==Example==\nFor a simple example, see [[Dataset class#Dataset example|\"Dataset example\"]].\n\n==See also==\n{{Template:Dataset:ReadRecord footer}}"
                    }
                ]
            }
        }
    }
}