0

Code help please

Hi folks I keep getting symbol expected:end at line 9,column 9 any ideas please.  Thanks

for i in select Table1 where 'Yes / No' = true do
let k := i.this;
let f := i.firstname;
let l := i.lastname;
delete (select Table1 where Id = k);
let t := (create Table2);
t.(firstname := f);
t.(lastname := l)
openTable("Table2");
alert("Records with ""Yes"" have been moved to Table2")
end

7 replies

null
    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    looks like you are missing the (semi colon ;): at the end of line 8

    • Faldo
    • 2 yrs ago
    • Reported - view

    Ok thanks will try later.

    • John_Halls
    • 2 yrs ago
    • Reported - view

    Hi Faldo

     

    This code can be shortened to

     

    for i in select Table1 where 'Yes / No' = true do
       let t := (create Table2);
       t.(
          firstname := i.firstname;
          lastname := i.lastname
       );
       delete i
       end;
    openTable("Table2");
    alert("Records with ""Yes"" have been moved to Table2")

     

    Regards John

    • Faldo
    • 2 yrs ago
    • Reported - view

    Yes thankyou very much working fine.

    • Faldo
    • 2 yrs ago
    • Reported - view

    Ok John will try too later on.

    thank you.

    • Faldo
    • 2 yrs ago
    • Reported - view

    That's brilliant deletes old records too.  Thank you.

    • Faldo
    • 2 yrs ago
    • Reported - view

    Hi how could I display something to say not deleted if they choose no.

Content aside

  • 2 yrs agoLast active
  • 7Replies
  • 245Views