Page 1 of 1

Posted: 29 Jun 2013, 15:05
by sephult
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

Posted: 30 Jun 2013, 20:40
by bsork
Hi, SetValue is for numbers, while SetStringValue is for strings...

This example works:

Code: Select all

begin                 
 dataread := 'Empty';                                      
 SetStringValue(output,dataread);
end;

Posted: 02 Jul 2013, 01:19
by sephult
Thanks a ton bsork!

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

-S