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": "Readfile",
        "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": {
            "72": {
                "pageid": 72,
                "ns": 0,
                "title": "ReDim",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "ReDim [''Preserve''] ''nameA''[([''subscriptA''[, ''subscriptB''[,''subscriptC''...]]])][, ''nameB''...[, ''nameC''...[...]]]\n\n== Description ==\n\nReDim is used to reallocate storage space for fixed arrays. The required component, ''name'', is the name of the variable, and it must follow standard variable naming conventions. The optional list of subscript arguments are the dimensions of an array variable, up to 60 comma separated, numeric expressions can be used. The optional keyword, ''Preserve'' will preserve data in an existing array, when only the size of the last dimension is changed. The lower bound of an array is always 0.\n\n== Example ==\n\n<pre>\nRem ReDim Example\n'ReDim reallocates array storage\n'An empty variable named \"Foo\"\nDim Foo\n'A one-dimensional array with 10 elements\nReDim Foo(9)\n'A two-dimensional array with 600 elements\n'20 x 30\nReDim Foo(19, 29)\n</pre>\n\n== Related Items ==\n\n[[array|Array]], [[dim|Dim]]\n\n[[Category:Language Reference]]\n\n[[Category:Variables]]"
                    }
                ]
            },
            "127": {
                "pageid": 127,
                "ns": 0,
                "title": "ReadFile",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "ReadFile (''filename''[,''method''[, callBack]])\n\n== Description ==\n\nNote: This function can be replaced by the [[Ajax]]() function.\n\nReadFile will read ''filename'' which can either be deployed with the app or be on the same server as the app. If the file is to be deployed with the app, include it in the manifest. This function will only work when deployed to a website: it will not work when deployed to a local folder.\n\nUse ''method'' to define the access method. Usually this parameter can be left out: the default is Get. The next most common value for this is Post. Post responses are never cached, whereas Get responses can be. Post also allows larger data transfers. Other methods are Connect, Delete, Head, Options, Put, Trace, or Track. For more information on these options, look up XMLHttpRequest on the web. The function is based on XMLHttpRequest. See the ReadFile.nsx sample in Samples folder 7 \"Ajax and ReadFile\".\n\nIf you supply a ''callBack'' argument, a function with that name will be called when the read is complete. Adding this option will cause the operation to become asynchronous. The next statement after ReadFile will be executed immediately, before the read is complete. This results in smoother operation for the user, especially if the file is on a remote server. \n\nIf you do not use a ''callBack'', you will see a warning in the [[Using the Chrome Debugger|Chrome Debugger]]:\n<pre>\nSynchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects \nto the end user's experience. For more help, check http://xhr.spec.whatwg.org/.</pre>\n\nIt returns two values: .status = 0 or 200 if the file was read successfully and .responseText which has the entire contents of the file. If the file is not read successfully, a different status code is returned in .status.\n\nThere is no equivalent WriteFile. Use [[Sql]], [[LocalStorage]] or a [[Using_Cordova_Plugins|Cordova plugin]] to save data.\n\n'''Returning the latest file contents\n'''\n\nYou can also pass a file location to ReadFile using this approach\n\n<pre>\nDim usrFile, req\nusrFile = \"users/12345.xml?\" & SysInfo(10)\nreq = ReadFile(usrFile)\n</pre>\n\nThe <code>?\" & SysInfo(10)</code> at the end of the .xml ensures that the latest file on the server is returned. This is useful where you perhaps update the file and want to return the latest version later on within your application. Excluding this will only return the last cached file contents that you read.\n\n== Example ==\n\n<pre>\nRem ReadfileFile example\nfilename=\"g.txt\"\nreq=ReadFile(filename)\nIf req.status=200 Then\n  MsgBox req.responseText\nElse\n  MsgBox \"File could not be read\"\nEnd If\n</pre>\n\n== Related Items ==\n\n* [[Ajax]]\n\n[[Category:Language Reference]]\n\n[[Category:Miscellaneous]]"
                    }
                ]
            }
        }
    }
}