This file object method will open the file so the script is able to manipulate records within the chosen file. If you manually open a file, make sure you have a following close when you're finished with the file.
You only need to use open if you have defined your file with 'userOpen' as true.
Parameters
- Array of keys. Get the next record by key. If the file has no keys, it will default to the RRN.
- Boolean noLock. If true, no lock will be created.
- String recordName. Record format name.
- (Optional) Data strucutre. If a DS is passed in, the recieved buffer from the file will be placed into the specified DS.
Return Value
None.
Exception Handling
If there is a problem creating the data area, an Error API fetches the record specified by the search argument from the file.
Parameters
...
search argument
The value can be anumber
,string
, orarray
value specifying arelative record number
(RRN
),key value
, orlist of key values
(array
ofnumber
/string
).don't lock (optional)
Aboolean
true
can be passed to avoid locking the record if the file is open forupdate
/delete
. If this parameter is set toboolean
false
or omitted records will be locked forupdate
/delete
files.record format name (optional)
Astring
value specifying the record format name can be passed.input data structure (optional)
A Profound.jsdata structure reference
can be passed.If specified, the referenced data structure will be populated with the record data. If the data structure is not qualified, you must wrap the parameter with the pjs.ds() API.
Section | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
|
...
Example
Code Block | ||||
---|---|---|---|---|
| ||||
pjs.defineTable("productspmyfile", { read: true, keyed: true, levelIds: [ '4AFA8C636F188' ] }); pjs.define("data", { type: 'char', length: 50, varying: read: true }); //Find a record by the key. productsp.myfile.getRecord([101]); //If the record has been found.. if (productspmyfile.found()) { data = pjs.char(prid); }doSomething(); |
Video Tutorial
Widget Connector | ||||||
---|---|---|---|---|---|---|
|