PxPlus User Forum

Twitter Twitter Twitter

Author Topic: OPEN STATEMENT AND IOLIST  (Read 769 times)

steven.rajski

  • Member
  • **
  • Posts: 12
    • View Profile
OPEN STATEMENT AND IOLIST
« on: July 20, 2021, 12:25:05 PM »
I have code to OPEN and SELECT records from a file M1TEMP.  I want to print out the first 2 fields but get no data.

1340 OPEN:
1360 LET M1TEMP=%FILEOBJ'OPEN("M1TEMP")
2000 ! ^1000,20
2020 MAINLINE:
2080 SELECT * FROM "M1TEMP" BEGIN "" END $FF$
2140 PRINT M1TEMP.CUSTOMERNUMBER$," ",M1TEMP.SEQUENCENUMBER$; INPUT *
2160 NEXT RECORD

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: OPEN STATEMENT AND IOLIST
« Reply #1 on: July 20, 2021, 01:59:51 PM »
line 2080 should probably be

2080 SELECT *,Rec="M1TEMP" FROM M1TEMP BEGIN "" END $FF$

Removing the quotes around M1TEMP in the from. M1Temp is the variable that holds the handle to the open file so you want to specify it. With the quotes you are specifying the string "M1TEMP"

You are also using a prefix before the field names but you do not have REC=prefix$ define in the select. You can either add the rec="M1TEMP" after the field list (in your case *) or you can modify the print to remove the M1TEMP. prefix on the fields.
Principal Software Engineer for PVX Plus Technologies LTD.

steven.rajski

  • Member
  • **
  • Posts: 12
    • View Profile
Re: OPEN STATEMENT AND IOLIST
« Reply #2 on: July 20, 2021, 02:10:33 PM »
Thank you, Devon.  I'm new to pvx but I have been programming in BBx for many years.