Script Library

Can I store blocks of GPscript code in a library and then recall it at run time into my Script or Sciptlet?

Despite the name, GP Script is a compiled language, not an interpreter so it has to be compiled before it can be used?

What are you trying to do?

I am just trying to clean up my code by placing some of my code in an external library and then referring to it in my code E.G. $Include MyFunction XYZ

I did see how to do this in some post a while ago, but I searched and can’t find it in the community posts or in the documentation.

It’s clearly documented in the language manual

Yes, thank you, this is exactly what I was trying to find. :slight_smile:

However, I have a question on how to find this information in the future:

  1. Am I using the correct documentation? Search — GPScript 4.1 documentation

  2. When I search for “include” in the search box, it does not find a reference for including GPscripts:

Also, do I place my GPscript code manually or is there some other mechanism to do this?

Thank you. I feel so dumb not doing this in the first place. LOL! … as I was reading the wrong documentation.

I read the section on the Include statement and I tried it thusly:

  1. I placed my script file: “SetTabsMode.gpscript” into the directory “C:\Music Content\DesKew Technologies\Gig Performer\Scripts”.

  2. In my current script file, I refer to “SetTabsMode.gpscript” by saying "Include “SetTabsMode.gpscript”.

  3. I suppose that works because the compiler did not throw an error when it parsed the statement.

  4. However, When I used this statement: SetTabsMode(“PATCH”) in my current script, I received this error "013024 - DESIGN (Rackspace) - Semantic error in “Main”: Line 720, Col 5: Unknown identifier: SetTabsMode
    " which says it cannot find the function “SetTabsMode” in my included script.

  5. Here are the first 10 lines or so from my included script:

Function SetTabsMode(pMode : String)

var
    i, j : integer
    PATCHnumber : Integer

Mode = pMode  SetWidgetLabel(Mode_Label,Mode)

If TestPrintMode Then Print(“Enter SetTabsMode - curDexed: " +CurDexed +” Mode: " +Mode) End

Select

Mode == “PRESET” Do

SetWidgetOutlineColor(PRESETS_Label,WhiteColor)
SetWidgetOutlineColor(PATCHES_Label,InvisibleColor) 
SetWidgetHideOnPresentation(PRESET_SELECT, false) // Display the PRESET_SELECT Widget

Your C drive path does not look like the default gig performer location. Is that where you installed Gig Performer to? If you’re not storing the script in the default location, you’ll need to use an absolute path.

I tried it this way:

Include “C:\Music Content\DesKew Technologies\Gig Performer\Scripts\SetTabsMode.gpscript”

… and received an error at compile time. I think the problem is that GPscrpt will not let me start an Include script with a Function.

Example:

Function SetTabsMode(pMode : String)

var
    i, j : integer
    PATCHnumber : Integer

Mode = pMode  SetWidgetLabel(Mode_Label,Mode)

etc. etc.

End

How can I find where the GP Default Drive Location is?

How can I find where the GP Default Drive Location is?

Read the documentation!
File locations in Gig Performer

1 Like