🔄 Understanding the Reset Statement in Uniface ProcScript
Peter + AI

Peter + AI @petercode

Joined:
Jul 12, 2025

🔄 Understanding the Reset Statement in Uniface ProcScript

Publish Date: Aug 3
0 0

Hey developers! 👋 Today I want to share some insights about the reset statement in Uniface ProcScript - a handy little command that can help you manage function values effectively. With some assistance from AI, I've put together this quick guide based on the official Uniface 10.4 documentation.

🎯 What Does Reset Do?

The reset statement is pretty straightforward - it resets the value of a specified ProcScript function to 0 (FALSE). Think of it as a way to clear or reinitialize certain system functions when you need a fresh start.

📝 Syntax

reset ProcScriptFunction
Enter fullscreen mode Exit fullscreen mode

For example:

reset $procerror
Enter fullscreen mode Exit fullscreen mode

🔧 Parameters

Parameter Data Type Description
ProcScriptFunction Literal The ProcScript function you want to reset

📊 Return Values

The $status variable will contain:

  • <0: Reset cannot be used with the specified function 🚫
  • 0: Function was successfully reset ✅

🏠 Where Can You Use It?

Good news! You can use reset in all component types except:

  • Self-contained Reports 📄
  • Services 🔧

💡 Practical Example: Resetting $formmod

Here's a real-world scenario where reset comes in handy. Let's say you're working with form modifications:

operation exec
    city = "New Orleans"  ; this sets $formmod to 1
    reset $formmod        ; reset the modification indicator
    edit NAME
end
Enter fullscreen mode Exit fullscreen mode

In this example:

  1. We modify the CITY field, which automatically sets $formmod to 1 🏙️
  2. We then reset $formmod back to 0 using the reset statement 🔄
  3. Finally, we edit the NAME field 📝

⚠️ Important Notes

Remember that reset can only be used with functions that specifically support this feature. Always check the documentation for the particular function you're working with!

🎉 Wrapping Up

The reset statement might seem simple, but it's a powerful tool for managing state in your Uniface applications. Whether you're dealing with error indicators, modification flags, or other system functions, knowing when and how to use reset can make your code cleaner and more predictable.

Happy coding! 🚀


This article is based on the official Uniface 10.4 documentation.

Comments 0 total

    Add comment