Welcome to %s forums

BrainModular Users Forum

Login Register

[Scripting] HollyHock 1.01.007d

I need help on a Patch
Post Reply
sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 29 Jun 2013, 15:05

Hello,

Started working with learning the scripting interface as I am having other issues with HollyHock that is preventing me from moving further.
I was curious if the scripts were working properly in HollyHock (Noticed Wiki Disclaimer) or if I was not doing something right in the following basic script:

Summary: Creating an output to feed a text field, set a string and the output to 'Empty'

--------------------------------------------------------------------------------------------------------------------------------------------
//////////////////////////////////////////////////////
// Script example
//
//////////////////////////////////////////////////////

//////////////////////////////////////////////////////
// Paramters declaration
//////////////////////////////////////////////////////

var output: Tparameter;

var dataread: String;

//////////////////////////////////////////////////////
// initialisation procedure
//////////////////////////////////////////////////////
procedure init;
begin

output := CreateParam('output',ptTextField );
SetIsInput(output,false);

end;

// Global Variables

//////////////////////////////////////////////////////
// Main Loop procedure
//////////////////////////////////////////////////////
Procedure Process;
begin

SetStringValue(dataread, 'Empty');
setvalue(output,dataread);

end;
----------------------------------------------------------------------------------------------------------


I then tie a text field to the output, however I cannot get the output of the script to push 'Empty' to the text field.

Any advice?

-S
"Every act of creation is first an act of destruction." -Picasso

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 30 Jun 2013, 20:40

Hi, SetValue is for numbers, while SetStringValue is for strings...

This example works:

Code: Select all

begin                 
 dataread := 'Empty';                                      
 SetStringValue(output,dataread);
end;
Bjørn S

sephult
Member
Posts: 1144
Contact:

Unread post by sephult » 02 Jul 2013, 01:19

Thanks a ton bsork!

I finally got to verify and now back on track, much appreciated!

-S
"Every act of creation is first an act of destruction." -Picasso

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests