PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Composite String Record behaviour in an object.  (Read 652 times)

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Composite String Record behaviour in an object.
« on: August 09, 2022, 12:24:26 PM »
I use records frequently as object parameters and find the structure neither remains after the enter, or in a local variable.  So I must do the following in every method. Except I've found debugging that a variable of len 9 will not return data from a composite string although the structure is there. Note: I have not played with how long a variable still works.   Curious if I missed something in documentation,  if this is unusual  behavior, or just an object limitation?  version 2017 on Linux.

! Doesn't work
ENTER (FILEREC$),(FILEIOL$)
DIM AAARecord$:fileiol$
AAARecord$=FILEREC$
phone$=AAA.RoadsideAssistenceNumber$
? lst(iol(AAARecord$))  ! will show Structure. 
? str(AAA.RoadsideAssistenceNumber$:"xxx-xxx-xxxx")
   -   -   

! This works
ENTER (FILEREC$),(FILEIOL$)
DIM AAA$:fileiol$
AAA$=FILEREC$
phone$=AAA.RoadsideAssistenceNumber$
? str(phone$:"xxx-xxx-xxxx")
888-888-8888

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Composite String Record behaviour in an object.
« Reply #1 on: August 09, 2022, 12:43:27 PM »
Is it just a typo in what you posted or did you really mean

? str(AAARecord.RoadsideAssistenceNumber$:"xxx-xxx-xxxx")

and not

? str(AAA.RoadsideAssistenceNumber$:"xxx-xxx-xxxx")

Which was what you posted?
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Peter.Higgins

  • Diamond Member
  • *****
  • Posts: 124
    • View Profile
Re: Composite String Record behaviour in an object.
« Reply #2 on: August 09, 2022, 12:55:29 PM »
Mike,
Its a typo and should be str(AAARecord.RoadsideAssistenceNumber$ or str(Phone$ 
The summary is in an Object, composite strings for AAA$ & AAARec$ work but AAARecord$ will not. 
AAA is a place holder for a number of file names fortunately all 3 letters. 
Please note on the system in question that AAARecord.RoadsideAssistenceNumber$ works in a run or called program just not in objects.