SUBROUTINE TestWrite ************************************************************************** * TestWrite.bas - (C) 2014 James Nonnemaker / james(at)nonnemaker.us * * This is a sample UniBasic (PICK Basic) program to access an Inormix DB. * * This program asks the user to enter a record ID to update and also to * enter the new status to update. It will then update the database if * all data is entered and the record actually exists. * * Although this program does function, it is intended for demonstration * purposes only, if you require a true program in UniBasic, feel free * to contact me. ************************************************************************** OPEN "DUMMY" TO DB.DUMMY ELSE END PRINT "ENTER RECORD ID: " INPUT RECORD.ID PRINT "ENTER NEW ORDER STATUS: " INPUT ORDER.STATUS IF RECORD.ID # "" AND ORDER.STATUS # "" THEN READU DUMMY.DATA FROM DB.DUMMY,RECORD.ID ELSE PRINT "ERROR. RECORD NOT FOUND" IF DUMMY.DATA<1> # "" THEN DUMMY.DATA<7> = ORDER.STATUS WRITE DUMMY.DATA TO DB.DUMMY,RECORD.ID END ELSE PRINT "ERROR. RECORD IS BLANK." END PRINT "SUCCESS! RECORD UPDATED." END ELSE PRINT "ALL INFORMATION IS REQUIRED TO UPDATE A RECORD." END