0.85 Beta: Error when executing scripts

Report a bug or a problem.
Post Reply
Wurlitzer
Newbie
Newbie
Posts: 38
Joined: Mon Sep 13, 2010 11:09 am

0.85 Beta: Error when executing scripts

Post by Wurlitzer »

Hello,

with the last full version of TGF I used the following script to copy the composer data into the lyricist fields:

Code: Select all

Program composer_to_Lyricist;

var
  i, iCount: integer;
  sComposer: string;
begin

  iCount := on_getGrdRowCount;
  if iCount = 0 then exit;

  for i := 1 to iCount do begin
      on_setGrdRow(i);

      on_LoadFile;
      sComposer := on_getGrdField( 'Composer' );

      gTag.Lyricist := sComposer;
      gTag.OrigLyricist := sComposer;

      on_UpdateThis( false );
  end;
  on_setGrdRow(1);
end.
When I was trying the script in the new 0.85 beta the following error message appeared:

Compiling...
Compiler: [Error] (8:13): Unknown identifier 'on_getGrdRowCount'

Bye Byte & Happy Coding
Wurlitzer

User avatar
jtclipper
Administrator
Administrator
Posts: 768
Joined: Tue Aug 10, 2010 12:04 pm

Re: 0.85 Beta: Error when executing scripts

Post by jtclipper »

A few redundant online script functions have gone away due to the new unified grid, the help file is updated to reflect that.
I edited your script to the following, try it and let me know.

Code: Select all

Program composer_to_Lyricist;

var
  sComposer: string;
begin
  if not tg_init then exit;
  repeat
    tg_loadFile;
    sComposer := tg_getField( 'Composer' );
    gTag.Lyricist := sComposer;
    gTag.OrigLyricist := sComposer;
    gTag.SavetoFile( 0, false, false );
  until not tg_skip;
end.

Wurlitzer
Newbie
Newbie
Posts: 38
Joined: Mon Sep 13, 2010 11:09 am

Re: 0.85 Beta: Error when executing scripts

Post by Wurlitzer »

@jtclipper

With the newest beta from yesterday there is a strange behaviour. When clicking on the button to execute the script in the online panel nothing happens. All scripts can't be executed. Do I have to activate it or is it a bug?

User avatar
jtclipper
Administrator
Administrator
Posts: 768
Joined: Tue Aug 10, 2010 12:04 pm

Re: 0.85 Beta: Error when executing scripts

Post by jtclipper »

The above script can be either .sct or.scl.
Which scripts give you trouble? do you have any custom ones?

Wurlitzer
Newbie
Newbie
Posts: 38
Joined: Mon Sep 13, 2010 11:09 am

Re: 0.85 Beta: Error when executing scripts

Post by Wurlitzer »

@jtclipper

.scl makes trouble (all files that come with TGF, the custom scripts I use are only modifications of the script I posted here, which means scripts to copy data from one tag field to another)
.sct is working (BTW: the script is executed very fast)

Post Reply