HTP. - HTTP Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Internet and Network > HTP. - Command > !HTP-General - General HTTP operations and utilities > !Configuration - Commands for setting up HTTP environment (timeouts, headers, proxy) >

HTP. - HTTP Operations

HTP.ClrErr

Previous Top Next


SPR Script Language

 

HTP.ClrErr

Clears the last HTTP error, optionally including error history.

 

Intention

 

The HTP.ClrErr command in SPR resets the last recorded HTTP error state, allowing subsequent HTTP operations to start fresh. You can optionally specify a flag ($$HIST as 0 or 1) to decide whether to clear the error history as well. This is useful for cleaning up after handling errors from commands like HTP.Request or HTP.ReqShort.

 

It’s like hitting the reset button for your robot’s HTTP troubles—HTP.ClrErr wipes the slate clean, with an option to erase the past too.

 

Illustration

🧹 Clear: HTP.ClrErr resets the last error.
🗑️ Full Reset: HTP.ClrErr|1 clears error history too.

 

Syntax

 

HTP.ClrErr[|$$HIST]

 

Parameter Explanation

 

P1 - $$HIST - (Variable, Numeric, Optional)

Flag to control history clearing (e.g., $$HIST as "0" or "1"). If 0 or omitted, only the last error is cleared; if 1, the error history is cleared too.

 

Examples

 

'***********************************

' HTP.ClrErr - Sample 1: Clear Last Error

'***********************************

HTP.ClrErr

MBX.Last HTTP error cleared

MBX.Ready

'

'***********************************

' HTP.ClrErr - Sample 2: Clear Error History

'***********************************

HTP.ClrErr|1

PRT.Last error and history cleared

MBX.Ready

'

 

Remarks

 

- Resets the last HTTP error state for subsequent operations.

- Use $$HIST=1 to clear error history; $$HIST=0 or omitting it clears only the last error.

- Typically used after error handling with HTP.GetErr.

 

Limitations

 

- Does not return a status; assumes HTP_ClearError succeeds.

- History clearing depends on HTP_ClearError implementation.

 

See also:

 

HTP.GetErr

HTP.GetErrText