PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Peter.Higgins

Pages: 1 2 3 [4] 5 6 ... 9
46
Language / Re: Error handler Object handling.
« on: May 14, 2021, 12:08:21 PM »
Mike,
How does For Program work for a Run, such as Run Menu?

47
Programming / Re: Composite Strings & BBx® Templates in objects
« on: January 28, 2021, 09:02:39 AM »
Welcome to the rabbit hole of the most confusing and feature rich area of Pxplus.
The documentation is at best a glossy magazine page for the functionality and permutations of ways that these concepts can be strung together.  BBx template functionality is almost entirely undocumented.  I keep a note document of around 20 different undocumented examples of how IOLs and templates can be used with arrays, fixed strings, and records.

Dimming a Composite:
Dim Var$:compiled iol  [iol=, iol(), cpl("iolist ...")]
Listing a Composite: ? LST(IOL(var$))

Dimming a BBx style template
Dim Var$: text template 
Listing a Composite: ? XFA(Var$)

Below are a few date parsing routines, one of which I contributed to the list a while back.

! Parse Fixed String to numbers with BBx style Template (dim again using xfa(Dt$) in Pxplus to use with read record)
1 DIM Dt$:"Y:N(4),M:N(2),D:N(2)"
2 Dt$="20191105"
3 ?Dt.Y
4 ?Dt.M
5 ?Dt.D

! Parse Fixed String to numbers with Dynamic IOL
1 DIM Dt$:CPL("IOLIST Y:[NUM(4)],M:[NUM(2)],D:[NUM(2)]")
2 !
3 Dt$="20191105"
4 ?Dt.Y
5 ?Dt.M
6 ?Dt.D

! Parse Fixed String to numbers with using Documentation.
1 IOL.dt: IOLIST Y:[NUM(4)],M:[NUM(2)],D:[NUM(2)]
2 DIM Dt$:iol=iol.dt
3 DTM06$="20191105"
4 Dt$=DTM06$,DayOfWeek=NUM(DTE(JUL(Dt.Y,Dt.M,Dt.D):"%W"))
5 ? DayOfWeek




48
Programming / Re: Composite Strings & BBx® Templates in objects
« on: January 27, 2021, 08:51:23 PM »
Just found that some Composite Strings work and some don't work.
Still working on why, but it appears that when the variables have a local definition in the declaration, the Composite String record access is prevented. 

49
Programming / Composite Strings & BBx® Templates in objects
« on: January 27, 2021, 03:35:38 PM »
I've used Composite Strings & BBx® Templates in objects to keep record data separate for many years with SAGE and INFOR code.  I find  with pxplus Ver 2017 this does not work and guessing it may have only worked in the forked versions.

When a template or iolist is used to DIM the record variable's "Structure" it loads the record and explodes the internal IOLIST variables but not as record prefixed variables. I have tested this many ways without any change.
How can I keep different records with random matching field names separate in objects?

4760 dim AR1: "CUST_DIV:C(2),CUST_CODE:C(8)"
or
4760 dim AR1$:iol(AR1:*)

4770 READ DATA FROM objar1'readrecord$(shipto$),REC=ar1$ TO IOL=objar1'iolist$
or
4770 AR1$=objar1'readrecord$(shipto$)
3}?AR1.CUST_DIV$

3}?CUST_DIV$
00

50
Language / Re: Error handler Object handling.
« on: January 15, 2021, 11:57:00 AM »
Thanks Mike,

Cannot believe something this important has been around for 15+ years and I am just now learning it even after taking 3 dedicated months to learn what I missed after going down the Sage & Infor fork rabbit holes.

"For Windows" is perfect for regular nomads programs.
 
"For Program" says "the current program level is exited." Does this mean the object only persists while on one level, or through higher level calls/methods?

51
Language / Error handler Object handling.
« on: January 14, 2021, 02:53:54 PM »
Looking to add an object manager to programs and the error handler so it can drop them.

At first I thought *master might work, but not in *nix from the results I get. 

I also was thinking there was a newish object manager utility to keep object references in, but all I can find that is useful is the *obj/collection.pvc which leaves a lot of coding to implement everywhere else.

Am I missing one somewhere?

52
Programming / Re: grid help fill up
« on: January 14, 2021, 02:41:55 PM »
Enrique,

Grid are difficult, but a few concepts really help reduce the information overload.

The cell clicked on is not the row/column that will be updated.  row/column must changed to that location.

Row properties are numeric, but columns can be the column number, or the variable name. Variable names are more better as columns can be rearranged easily. 

Each grid method in windx goes out to the client and then back.  Get to know the "Pseudo Multi-Properties" or "Multi-Property Access" techniques to do as many of the changes in one shot.  These are usually pretty common so I use a grid utility object to process the majority of these.

Treat each line as a record rather than dealing with cells individually.  This is much simpler, just like we don't deal with just fields in file records.  See Load/Access by Row Grid Properties.  When the columns are rearranged, this keeps your head from exploding.

Grid Formats can be both set and obtained in the program so one grid can work with any file.  This is how I do logging displays.  I use the dictionary objects to build format strings, but the IOLists can be parsed, or Format strings for each put in the program, etc.  I would encourage you to learn this over using the nomads entry. It makes programs with grids much easier to reuse.   If a column should be hidden, set the width to zero so the format and record iolist remains constant.

The grid commands simplify most of the work.  Putting the records into one string and then a grid write of the whole list is quick and easy. 

To compare original records to grid changes, use a memory file to copy the records to first, then compare memory record to row record for real changes.

Do formatting and colors after loading data.  It is much more efficient.
 

53
Nomads / Changing the Screen_ID$ property of a Nomads Object
« on: December 29, 2020, 02:22:53 PM »
I am exploring if the same object nomads program can be used to display both a dialog and a child window (suffixed with a "C").  Will the process() method accept an parameter in Object Nomads because the below seems to be using the Dialog? 

-}x=new("EPCVEW")
-}?X'*
BT_Excel(),BT_Exit(),BT_First(),BT_Last(),BT_Next(),BT_Prev(),ChangePoNumber(),C
hangeProfile(),CloseWindow(),GETNAME$(),GETVARIABLE$(),GetClass$(),GetQry$(),Get
Type$(),JUMPTO(),OnExit(),PROCESS(),PanelCompleted(),PanelInitialized(),PostLoad
(),PreLoad(),REFRESHSCRN(),SCREEN_ID$,SCREEN_LIB$,SetFilter(),SetQry(),SetSecuri
tyCode(),_Parent,
-}x'screen_id$="EPCVEWC"
Error #88: Invalid/unknown property name
-}x'PROCESS("EPCVEWC","EDI.EN")
-}DROP OBJECT X
-}

54
Nomads / cmd_str$="End" not working in object nomads issue
« on: December 18, 2020, 01:26:13 PM »
Occasionally I see this issue and cannot remember how it was solved. 

Issue:

On a new object nomads Dialogue panel copied from a template panel and modified, the Cmd_Str$="End" will run the ON_EXIT and ON_DELETE logic, but the panel hangs there active.  Using a tested program structure template so both procedures have return values of 1.  Using Developer package windx to connect to a Centos system.   Using a bunch of objects but moving them around between on_delete and on_exit makes no difference.  Putting an extra Cmd_Str$="End" in the on_exit does nothing either. 

I think the solution last time was to delete the nomads entry and re-create the panel.   
This panel is very large and complex to reenter manually.

Any ideas why this is happening?
After exporting and reimporting and still no joy, I realized the template had lost the local return flags so ON_EXIT and ON_DELETE were returning 0.   :-[

55
Language / Re: Object Function Dynamic Parameter Question
« on: November 27, 2020, 06:38:34 PM »
Testing has shown that this doesn't work.  Only the (*) is accepted by 2017.
I am experimenting with flexible Enter statements using arrays instead. 

56
Language / Object Function Dynamic Parameter Question
« on: November 27, 2020, 12:13:56 PM »
Hello List,

I am considering a generic Object Key function that returns the padded value for any index of a file set in object instantiation without the overhead of using dictionary objects.  Thanks for the Key() tip Mike.   

There are examples of fully variable parameters here, but I could swear I've seen mixed versions that have the variable portion at the end.  I have been unable to find this in the forum or by searching the documentation. 
I guess the easy answer is directions to dynamic parameters in the documentation.

Assuming by value will work in a compiled iolist variable and the STATIC ckeyIolist$ is
ckeyIolist$=CPL("IOLIST (param1$), (param2$),(param3$),(param4$)")
this is how I think it probably could work. 

 FUNCTION KeyFmt$(KeyNo,*)KEY_FMT ! Where * is the fields of the key.
 !
 KEY_FMT:
 Pt$=STK(PROPERTIES);  IF NOT(MSK(pt$,"[Nn][Ss]+")) then EXIT 36
 ENTER (KeyNo),iol=ckeyIolist$,err=*next
 argCnt=LEN(Pt$)
 ! Format into key


57
Programming / Iolist for internal keys
« on: November 21, 2020, 02:21:32 PM »
Is there a way in 2017 or later to write an IOlist for an internal mulitple field key so that the leading fields are padded with nuls?  LEN & CHR do not seem to have that ability.

58
Programming / Re: Binary auto increment key
« on: October 09, 2020, 02:21:28 PM »
Hi Rob,
Thanks for the example.
My guess is the key should be pre-padded with the default padding. 
The $00$ is the default pad for an internal keyed file which is used in your example, while the default for external is space. 


59
Programming / Re: Question on key padding
« on: September 17, 2020, 02:08:14 PM »
Thanks Eric.
The Keyed directive documentation was very helpful.  Been awhile since I read it.

60
Programming / Re: Question on a structure string
« on: September 17, 2020, 01:57:55 PM »
Hi Eric,
Missed you at Direxions! 
What was meant is the result was not a structure, just a string.   
Yesterday same environment gave consistent negative results with a direct assignment.
Today I retest same code both ways, and voila, it works both ways. 
:o

Pages: 1 2 3 [4] 5 6 ... 9