10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Build a Frame Dynamically/* Set up the file.rollback script */test_frame.Script.ConcatVarchar(text =on click file_menu.rollback_menu =' + HC_NEWLINE + HC_TAB + 'begin' +HC_NEWLINE + HC_TAB + HC_TAB + 'closetable_cursor;' + HC_NEWLINE + HC_TAB + HC_TAB+ 'rollback work;' + HC_NEWLINE + HC_TAB+ HC_TAB + 'return;' + HC_NEWLINE + HC_TAB +'end;' + HC_NEWLINE + HC_NEWLINE);/* Set up the edit.delete script */test_frame.Script.ConcatVarchar(text ='on click edit_menu.delete_menu =' + HC_NEWLINE + HC_TAB +'begin' + HC_NEWLINE+ HC_TAB + HC_TAB + 'delete from ' +table_choices + ' where current oftable_cursor;' + HC_NEWLINE+ HC_TAB + HC_TAB +'CurFrame.SendUserEvent(eventname =''Next'');' + HC_NEWLINE+ HC_TAB + 'end;' +HC_NEWLINE + HC_NEWLINE);/* Set up the edit.update script */test_frame.Script.ConcatVarchar(text ='on click edit_menu.update_menu = ' +HC_NEWLINE + HC_TAB + 'begin' + HC_NEWLINE +HC_TAB + HC_TAB + updatestring +HC_NEWLINE + HC_TAB + HC_TAB + ' wherecurrent of table_cursor;'+ HC_NEWLINE + HC_TAB + HC_TAB +'CurFrame.SendUserEvent(eventname = ''Next'');' + HC_NEWLINE+ HC_TAB + 'end;' + HC_NEWLINE + HC_NEWLINE);/* Set up the edit.next script */test_frame.Script.ConcatVarchar(text ='on click edit_menu.next_menu,' +HC_NEWLINE + 'on userevent ''Next'' =' +HC_NEWLINE + HC_TAB + 'begin' +HC_NEWLINE + HC_TAB + HC_TAB +fetchstring + HC_NEWLINE + HC_TAB + HC_TAB +'if table_cursor.State = CS_NO_MORE_ROWSthen'+ HC_NEWLINE + HC_TAB + HC_TAB + HC_TAB+ 'message ''No more rows.'';' + HC_NEWLINE+ HC_TAB + HC_TAB + 'endif;' + HC_NEWLINE +HC_TAB + 'end;' + HC_NEWLINE + HC_NEWLINE);3. To facilitate debugging, writes the completed script to a file using theWriteToFile method (defined for the StringObject class):test_frame.Script.WriteToFile("test.script");The WriteToFile method invoked in the preceding example creates a filenamed test.script.Creating a Frame at Runtime 415

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!