I'm not too familiar with the Prime Flavor, but doesn't the CASE and the setting of F.FILETOUSE need to be on separate lines or have a semi-colon (;)? CASE X=1 ; F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2
Curt Stewart TRI-SYS Consulting -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Tuesday, December 15, 2009 1:24 PM To: U2 Users List Subject: [U2] An interesting find.... Here is an interesting tidbit I happened to run across. PROGRAM A: OPEN "","FILE1" TO F.FILE1 ELSE STOP "NO FILE1" OPEN "","FILE2" TO F.FILE2 ELSE STOP "NO FILE2" * F.FILETOUSE = F.FILE1 (Adding this here will get rid of the compile warning) BEGIN CASE CASE X=1 F.FILETOUSE = F.FILE1 CASE X=2 F.FILETOUSE = F.FILE2 CASE -1 F.FILETOUSE = F.FILE1 END CASE READ XDATA FROM F.FILETOUSE,"TEST" ELSE XDATA="" The above program when compiled says F.FILETOUSE never assigned a value and when it executes, gives an improper file type error HOWEVER: PROGRAM B: OPEN "","FILE1" TO F.FILE1 ELSE STOP "NO FILE1" OPEN "","FILE2" TO F.FILE2 ELSE STOP "NO FILE2" F.FILETOUSE=F.FILE1 IF X=1 THEN F.FILETOUSE = F.FILE1 IF X=2 THEN F.FILETOUSE = F.FILE2 READ XDATA FROM F.FILETOUSE,"TEST" ELSE XDATA="" Compiles and run just fine, no errors. This is using UV 10.0.2 under the Prime Information flavor George Gallen Senior Programmer/Analyst Accounting/Data Division, EDI Administrator ggal...@wyanokegroup.com ph:856.848.9005 Ext 220 The Wyanoke Group http://www.wyanokegroup.com _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.716 / Virus Database: 270.14.107/2564 - Release Date: 12/15/09 01:52:00 _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users