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
    • 3 yrs ago
    • Reported - view

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

    • Faldo
    • 3 yrs ago
    • Reported - view

    Ok thanks will try later.

    • John_Halls
    • 3 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
    • 3 yrs ago
    • Reported - view

    Yes thankyou very much working fine.

    • Faldo
    • 3 yrs ago
    • Reported - view

    Ok John will try too later on.

    thank you.

    • Faldo
    • 3 yrs ago
    • Reported - view

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

    • Faldo
    • 3 yrs ago
    • Reported - view

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

Content aside

  • 3 yrs agoLast active
  • 7Replies
  • 247Views