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 ... 7
16
Wish List / Re: Key function addition
« on: June 07, 2021, 12:12:50 PM »

I am looking for generic Key padding that handles all keys for a file where only a key number and a
key string need to be passed, delimited if containing multiple fields.  A single string allows an easily
remembered generic interface. 

After you suggested the KEY function, I have found it to support a simple interface,
be very dependable and reduce revision and testing load. Definitely a huge improvement. 

Using ARG with KEY becomes more cumbersome than execute with numerous alternate keys
as testing a trailing :+null value generated an error.

KGEN would be perfect for a clean interface as I prefer passing records regardless of
key type and data layout to minimize future maintenance interface issues.  I can live
with the legacy edge case of the key not being in the data as that is becoming rare:)
Granted I don't remember having used KGEN in the last seven years but it has been on
my work around list for years due to prior edge cases with alternate keys
and with 2 forked versions. 

17
Wish List / Key function addition
« on: June 06, 2021, 07:20:37 PM »
Key function allows a key string to be generated when explicitly stated:
SELECT .... FROM <fileno> BEGIN KEY(<fileno>, KEY=S1$:S2$:S3$)

It would be quite useful for this to also work indirectly as in: 
K$=KEY(<fileno>, KEY=str$,sep=$3E$)
where string is s1Value$:s2Value$:s3Value$

Currently I am building a string for the whole command and executing it to get the key from object parameters.

18
Nomads / Re: Object Dependency question
« on: June 04, 2021, 06:18:06 PM »
I do pass objects as well which are not referenced in the on_delete. 
Is the shutdown of the object on error capable of shutting down the passed object?
For objects which end up with nothing in the On_Delete procedure, is there any benefit to removing the DELETE REQUIRED and the On_Delete procedure other than debugging convenience?

19
Nomads / Object Dependency question
« on: June 04, 2021, 05:10:25 PM »
I have been using business logic objects that instantiate other objects "FOR OBJECT" .  As it is convenient, I occasionally make the internal object handles available as properties with SET ERR rather than opening two instances. 
Now I'm wondering if the shutdown of these objects used outside the container object might be responsible for the occasional segment fault I get in testing? 

20
Nomads / Re: Object dependency For Windows
« on: June 03, 2021, 12:29:04 PM »
Thanks Mike.
Have a terrific day.

21
Nomads / Object dependency For Windows
« on: June 03, 2021, 11:45:48 AM »
I am curious if instantiating an object in the pre-display "FOR WINDOW" will garbage collect the object,  or if this must be done in POST-DISPLAY after window creation.   Thinking I've tested in v17 and it only worked in POST-DISPLAY.

22
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?

23
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




24
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. 

25
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

26
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?

27
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?

28
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.
 

29
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
-}

30
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.   :-[

Pages: 1 [2] 3 4 ... 7