2019-03-03 04:08:54 +01:00
|
|
|
clear() Netscript Function
|
|
|
|
==========================
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
.. js:function:: clear(portOrFilename)
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
:RAM cost: 1 GB
|
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
:param string/number portOrFilename: Port or text file to clear.
|
|
|
|
|
2019-07-14 05:55:58 +02:00
|
|
|
This function is used to clear data in a :ref:`Netscript Port <netscript_ports>` or a text file.
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
If the ``portOrFilename`` argument is a number between 1 and 20, then it
|
|
|
|
specifies a port and will clear it (deleting all data from the underlying queue).
|
2019-03-03 04:08:54 +01:00
|
|
|
|
2021-03-12 08:51:56 +01:00
|
|
|
If the ``portOrFilename`` argument is a string, then it specifies the name
|
|
|
|
of a text file (.txt) and will delete all data from that text file.
|