Topic: Having trouble with script

Here is what I have:   But I keep getting this error " Undeclared identifier: 'sid_mastersets' at 64:35      Any ideas on what I did wrong.

      // id_mastersets
               if arrStr[6] <> '' then
               begin
                    sid_mastersets := SQLExecute ('SELECT id FROM mastersets WHERE dbmastersets LIKE ''' + ReplaceStr(arrStr[6], '''', '''''') +'''');
                    if sid_mastersets = '' then
                    begin
                         SQLExecute ('INSERT INTO sets (dbmastersets) VALUES ('''+ ReplaceStr(arrStr[6], '''', '''''') +''');');
                         sid_mastersets := IntToStr(Last_Insert_id('mastersets'));
                         if sid_mastersets = '-1' then sid_mastersets := 'NULL';
                    end;
               end else sid_mastersets := 'NULL';


               SQLExecute ('INSERT INTO base (year, id_sets, [Player Name], number, [psa grade], [psa number], id_mastersets) VALUES ('+ arrStr[0]+','+ sid_sets+','+ arrStr[2]+','+ arrStr[3]+','+ arrStr[4]+','+ arrStr[5]+','+ arrStr[6]+','+ sid_mastersets+');');

Re: Having trouble with script

The Script seems to works fine, just have that red line on script with the error listed

But I keep getting this error " Undeclared identifier: 'sid_mastersets' at 64:35

Re: Having trouble with script

Hello taxijack

In your code, sid_mastersets has to be declared as a variable, which is not made here.
Declare it as Integer in the beginning of your procedure.
This should get better.

JB

4 (edited by taxijack 2015-07-26 12:20:48)

Re: Having trouble with script

Not tracking. I do not see what you are asking or where to Declare it a Integer. I cannot figure this out.

I have upload the full script.



Thanks,
Jack

Re: Having trouble with script

Hello taxijack

First of all,do you know Pascal language ?
MVD is coded in Delphi (pascal language) and uses for scripts Pascal.
To fully utilize MVD, some knowledge in Pascal is necessary. if only to understand the concept of variables.
If you don't know what is a variable or a constant), this explains the error message you.
Later we will see to help you

JB

Re: Having trouble with script

taxijack
Please attach your project here (zip file without exe and dll)

Dmitry.

Re: Having trouble with script

Here is the attached without dll or exe. I have tried to add on to the existing database from earlier. Sorry for all the trouble. Great help and support by the way. Bar none.

Thanks
Jack

Post's attachments

Attachment icon Basketball_Card_Database.zip 353.28 kb, 496 downloads since 2015-07-27 

Re: Having trouble with script

taxijack wrote:

Here is the attached without dll or exe. I have tried to add on to the existing database from earlier. Sorry for all the trouble. Great help and support by the way. Bar none.

Thanks
Jack

Fixed.

Post's attachments

Attachment icon Basketball_Card_Database_fixed.zip 211.45 kb, 481 downloads since 2015-07-27 

Dmitry.