PxPlus User Forum
Main Board => Discussions => Programming => Topic started by: Peter.Higgins 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
-
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,
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.