# I'm sure this is a basic Error, but help!

**URL:** https://forum.highend3d.com/t/im-sure-this-is-a-basic-error-but-help/4204
**Category:** Maya
**Tags:** mel
**Created:** [August 24, 2004, 8:00pm UTC](https://forum.highend3d.com/t/im-sure-this-is-a-basic-error-but-help/4204 "2004-08-24T20:00:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![justkidding1216](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@justkidding1216](https://forum.highend3d.com/u/justkidding1216)
#### Post date: [August 24, 2004, 8:00pm UTC](https://forum.highend3d.com/t/im-sure-this-is-a-basic-error-but-help/4204/1 "2004-08-24T20:00:47Z")

</div>

okay, newbie MEL scripting question.

I'm trying to create a GUI that allows me to load and unload shelves into a floating window. I've turned pretty much every action in the script into a proc. I thought that to organize my GUI, I could turn all the Layouts into different string variables $pLayout, $cLayout, etc. etc. and then parent the appropriate actions items to the appropriate Layout.

But the proc that builds the GUI is a different proc than the one that does "make new Shelf" (as an example), the strings $ aren't recognized.

So I thought; I'll make them into global variables!

And I got this error

Initialization of global variable "$cLayout" requires a constant value. //

What does that mean?!? And what's my solution?

I just want to create a button in the GUI that calls on a specific proc and places the RESULT of that proc in a user specificed place.

(Sorry if this post is long, it's the only way I could explain the problem)

Thanks!

---

<div class="post-metadata">

### Author: ![sboy](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/ac8455/32.png) [@sboy](https://forum.highend3d.com/u/sboy)
#### Post date: [August 24, 2004, 11:20pm UTC](https://forum.highend3d.com/t/im-sure-this-is-a-basic-error-but-help/4204/2 "2004-08-24T23:20:03Z")

</div>

That error means you have to first declare your global variables without assignment:

global string $cLayout;

or

global string $items[];

You may then assign them.

---

<div class="post-metadata">

### Author: ![justkidding1216](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/e5b9ba/32.png) [@justkidding1216](https://forum.highend3d.com/u/justkidding1216)
#### Post date: [August 25, 2004, 7:09pm UTC](https://forum.highend3d.com/t/im-sure-this-is-a-basic-error-but-help/4204/3 "2004-08-25T19:09:39Z")

</div>

thanks! I'll try that!
