# Global Variable

**URL:** https://talk.remobjects.com/t/global-variable/31735
**Category:** Remoting SDK
**Tags:** delphi
**Created:** [May 27, 2025, 2:38am UTC](https://talk.remobjects.com/t/global-variable/31735 "2025-05-27T02:38:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jorge\_Ortiz\_Zurita](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jorge_ortiz_zurita/32/18254_2.png) [@Jorge\_Ortiz\_Zurita](https://talk.remobjects.com/u/Jorge_Ortiz_Zurita)
#### Post date: [May 27, 2025, 2:38am UTC](https://talk.remobjects.com/t/global-variable/31735/1 "2025-05-27T02:38:41Z")

</div>

Good Day!

Where is the best place to store a variable that will contain a parameter that starts an executable:  
For example:  
myremobjectserver.exe -pi

This variable will contain true if executed with -pi or false if nothing is specified.

In service and method implementations, it is necessary to read this variable to make connections to production or test environments accordingly. This should be client-agnostic.

I was thinking of defining a logical global variable in the main form, assigning it true or false depending on whether the executable has this parameter or not.

Make use of the main form in service implementations, and read this variable to proceed accordingly within the function.

This variable will never be rewritten, so I think there would be no problems with concurrent readings.

Is this a correct approach?

Thanks for your advice.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [May 27, 2025, 1:44pm UTC](https://talk.remobjects.com/t/global-variable/31735/2 "2025-05-27T13:44:19Z")

</div>

I think a global variable – or a static/class field/property in on of your classes (if you want to me more OOP purist) – would be perfectly fine for this, yes.

---

<div class="post-metadata">

### Author: ![Jorge\_Ortiz\_Zurita](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jorge_ortiz_zurita/32/18254_2.png) [@Jorge\_Ortiz\_Zurita](https://talk.remobjects.com/u/Jorge_Ortiz_Zurita)
#### Post date: [May 27, 2025, 2:36pm UTC](https://talk.remobjects.com/t/global-variable/31735/3 "2025-05-27T14:36:39Z")

</div>

Many Thanks, i will try it that way.!
