SRL Archive - S.M.A.R.T. Questions and Answers.

Error in SmartParams


Fredecus

2012-11-25 02:47:26

Hey everyone. I just upgraded to smart 8.0 and am having a problem getting it started.

When I press start:

SRL Compiled in 0 msec
Error: Out Of Range at line 274
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]

This is the block of code:
(line 274 is the line beginning in "Result")

  end;

Result:= SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '')
If (Length(Params) <> 2) then
begin
Writeln('** Failed To Grab Smart Parameters **');
Writeln('** Please check your internet connection/firewall **');
TerminateScript;
Exit;
end;

I have the following installed:

Java 6u35 and Java 7
Newest version of Simba and all current updates
Classpath and Path are both set to the Java 7 lib and bin (maybe I did this incorrectly?)

Thanks for your help.

Justin

2012-11-25 04:08:48

Make sure you have
{$DEFINE SMART8}

In your script

E: Also noticed the snippit you posted has been edited… My SmartParams looks like


If (Not ForceNew) then
begin
Ids := SmartGetClientIDs;
Count := Length(IDs);
If (Count > 0) then
For I:= 0 To (Count - 1) Do
begin
If SmartPairClient(IDs[I]) then
begin
Result := IDs[I];
SetEIOSTarget('libsmartremote', ToStr(Result));
Writeln('Paired with SMART[' + ToStr(Result) + ']');
Exit;
end;
end;
end;

Params := GetSmartParams;
If (Length(Params) <> 2) then
begin
Writeln('** Failed To Grab Smart Parameters **');
Writeln('** Please check your internet connection/firewall **');
TerminateScript;
Exit;
end;

{$IFDEF SMART8}
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '');
{$ELSE}
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', -1);
{$ENDIF}

Fredecus

2012-11-25 05:22:17

I re-installed a few minutes ago and got it to work on 1 script, and the second time I got the same error.

I just copied your Param code into mine and it is working consistently. I am still a bit confused as to what would cause it but hey, if it works it works.

I greatly appreciate your help and hope you have a great day man.

vagabond

2012-12-04 09:18:57

It was a script issue for me, like Justin said make sure
{$DEFINE SMART8}
is in the script. Most scripts weren't written with S.M.A.R.T 8 in mind.