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.
76
Language / Unique alternate key question.
« on: February 07, 2020, 10:15:36 AM »
I am curious if it is possible to make an alternate multi-segment key unique in the dictionary where the secondary segments may repeat for other primary segments but should not for the primary segment which is also the first segment of the prime key? Thinking no-way but hope to be surprised.
77
Bernie,
Helpful hints:
The fmt$ control property allows you to set the columns format from post display. Instructions under grid control
Much easier to maintain or make dynamic, especially remotely.
Set properties using the propbag or Pseudo Multi-Properties control properties
(grd'row.colno.value.$="1,1,""Action"","
This reduces your response time tremendously.
Please do not torment yourself trying to deal with cell data. All I/O is best done by row, same as reading a record.
Loading is much faster by entire grid. Faster to set colors etc after the Data load than mixed in by row.
Control Property LoadIOList$ allows you to get the grids Iolist
gridIOL$=grd'LoadIOList$
Control Property rowdata$ allows you to get the data in or out.
Get: READ DATA FROM grd'rowdata$,SEP=gFDlm$ TO IOL=gridIOL$,ERR=*NEXT
Put: grd'rowdata$=REC(gridIOL$,SEP=gFDlm$)
Control Property Currentrow is not row, they are unrelated.
The first is for focus position, the second is for update position. Focus doesn't change update position.
Ditto with column.
Nomads has generic variables for controls including grids (See Object Nomads)
This makes generic code much easier.
id.row for row.
id for current control object.
id$ for current control name.
Helpful hints:
The fmt$ control property allows you to set the columns format from post display. Instructions under grid control
Much easier to maintain or make dynamic, especially remotely.
Set properties using the propbag or Pseudo Multi-Properties control properties
(grd'row.colno.value.$="1,1,""Action"","
This reduces your response time tremendously.
Please do not torment yourself trying to deal with cell data. All I/O is best done by row, same as reading a record.
Loading is much faster by entire grid. Faster to set colors etc after the Data load than mixed in by row.
Control Property LoadIOList$ allows you to get the grids Iolist
gridIOL$=grd'LoadIOList$
Control Property rowdata$ allows you to get the data in or out.
Get: READ DATA FROM grd'rowdata$,SEP=gFDlm$ TO IOL=gridIOL$,ERR=*NEXT
Put: grd'rowdata$=REC(gridIOL$,SEP=gFDlm$)
Control Property Currentrow is not row, they are unrelated.
The first is for focus position, the second is for update position. Focus doesn't change update position.
Ditto with column.
Nomads has generic variables for controls including grids (See Object Nomads)
This makes generic code much easier.
id.row for row.
id for current control object.
id$ for current control name.
78
Nomads / Re: How to exit a panel with an <Enter> key
« on: January 31, 2020, 12:57:20 PM »
Mike,
Or a button the size of the panel, in which case a click on the image would do the same as enter.
Or a button the size of the panel, in which case a click on the image would do the same as enter.
79
Programming / index object idxinfo.pvc
« on: December 24, 2019, 04:53:36 PM »
Can anyone tell me if the null suppression on the last segment for a Primary internal key is in anyway related to the K: or N: attributes in the index object?
! IF POS("N"=COLUMNATTR$) THEN IDXINFO'COLUMNATTR$="N",IDXINFO'COLUMNNULLCHARACTER$=MID(COLUMNATTR$,POS("N;"=COLUMNATTR$)+2,2),BuildColumnAttr$+="N"
! IF POS("K"=COLUMNATTR$) THEN IDXINFO'NULLSUPPRESS=1,IDXINFO'NULLCHARACTER$=MID(COLUMNATTR$,POS("K;"=COLUMNATTR$)+2,2),BuildAttr$+="K"
! IF POS("N"=COLUMNATTR$) THEN IDXINFO'COLUMNATTR$="N",IDXINFO'COLUMNNULLCHARACTER$=MID(COLUMNATTR$,POS("N;"=COLUMNATTR$)+2,2),BuildColumnAttr$+="N"
! IF POS("K"=COLUMNATTR$) THEN IDXINFO'NULLSUPPRESS=1,IDXINFO'NULLCHARACTER$=MID(COLUMNATTR$,POS("K;"=COLUMNATTR$)+2,2),BuildAttr$+="K"
80
Language / Re: Easy way to split a numeric fixed string.
« on: December 05, 2019, 05:32:38 PM »
Mike,
Read data works well for Julian (your example) or without DTE on a formatted date.
I am guessing but I suspect for String to Number, my original technique and the two PVX equivalents at the bottom of this reply will be very hard to beat on efficiency.
Good reasons to use a structured (or composite) string technique are:
1: because the original data is an un-formatted string and both original and parsed data are needed.
2: A Variable fits better than a formula into a IOLIST and accepts assignment which a formula can not.
3: in a tight loop of thousands/millions of records, READ DATA will run noticeably slower than either
multiple num(substring) or the structured string approach. (2002 list date functions thread)
4: Read/Assignment results can be fed directly into functions with implicit conversion.
Dt$=DTM06$,DayOfWeek=NUM(DTE(JUL(Dt.Y,Dt.M,Dt.D):"%W") )
5: Only one Dim of a string structure is necessary. CLEAR or DIM must be used to remove\change structure.
Re # 3: Your comments on the relative efficiency of these approaches will definitely be appreciated.
While not quite as simple and easy to remember as :N(len), strings to numbers can also be achieved with PVX composite string structures as in:
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
1 IOL.dt: IOLIST Y:[NUM(4)],M:[NUM(2)],D:[NUM(2)]
2 DIM Dt$:iol=iol.dt
3 Dt$="20191105"
4 ?Dt.Y
5 ?Dt.M
6 ?Dt.D
Read data works well for Julian (your example) or without DTE on a formatted date.
I am guessing but I suspect for String to Number, my original technique and the two PVX equivalents at the bottom of this reply will be very hard to beat on efficiency.
Good reasons to use a structured (or composite) string technique are:
1: because the original data is an un-formatted string and both original and parsed data are needed.
2: A Variable fits better than a formula into a IOLIST and accepts assignment which a formula can not.
3: in a tight loop of thousands/millions of records, READ DATA will run noticeably slower than either
multiple num(substring) or the structured string approach. (2002 list date functions thread)
4: Read/Assignment results can be fed directly into functions with implicit conversion.
Dt$=DTM06$,DayOfWeek=NUM(DTE(JUL(Dt.Y,Dt.M,Dt.D):"%W") )
5: Only one Dim of a string structure is necessary. CLEAR or DIM must be used to remove\change structure.
Re # 3: Your comments on the relative efficiency of these approaches will definitely be appreciated.
While not quite as simple and easy to remember as :N(len), strings to numbers can also be achieved with PVX composite string structures as in:
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
1 IOL.dt: IOLIST Y:[NUM(4)],M:[NUM(2)],D:[NUM(2)]
2 DIM Dt$:iol=iol.dt
3 Dt$="20191105"
4 ?Dt.Y
5 ?Dt.M
6 ?Dt.D
81
Language / Easy way to split a numeric fixed string.
« on: December 05, 2019, 12:58:19 PM »
I was looking at some complicated date logic and thought of contributing this simple efficient technique example. This uses the BBX string structures in PVX.
The numeric and formatting validation is omitted.
1 DIM Dt$:"Y:N(4),M:N(2),D:N(2)" ! Structure is static and can be reused after ="" or read data from $$
2 Dt$="20191105"
3 ? jul(Dt.Y,Dt.M,Dt.D)
4 ? xfa(Dt$,"") ! Roughly equivalent to LST(IOL())
5 ?Dt.Y
6 ?Dt.M
7 ?Dt.D
The numeric and formatting validation is omitted.
1 DIM Dt$:"Y:N(4),M:N(2),D:N(2)" ! Structure is static and can be reused after ="" or read data from $$
2 Dt$="20191105"
3 ? jul(Dt.Y,Dt.M,Dt.D)
4 ? xfa(Dt$,"") ! Roughly equivalent to LST(IOL())
5 ?Dt.Y
6 ?Dt.M
7 ?Dt.D
82
Wish List / Re: XML -> JSON CVS Translator
« on: October 15, 2019, 11:51:59 AM »
Hi Josh,
Enjoyed meeting you at Direxions!
Since JSON is a data format similar to csv rather than a document format like xml, I suspect you will still have to modify the original programs for individual nodes.
I suggest making a simple object to return the JSON string when passed a node object using similar logic I use to import XML straight to data IOLISTs.
tmp$=trn'node(n)'tag$+$24$
VIA tmp$=trn'node(n)'value$
Enjoyed meeting you at Direxions!
Since JSON is a data format similar to csv rather than a document format like xml, I suspect you will still have to modify the original programs for individual nodes.
I suggest making a simple object to return the JSON string when passed a node object using similar logic I use to import XML straight to data IOLISTs.
tmp$=trn'node(n)'tag$+$24$
VIA tmp$=trn'node(n)'value$
83
Programming / Error 12 instantiating an object
« on: October 09, 2019, 09:24:05 AM »
This might save you some time if you happen to run into it.
Was getting file error 12 on an object instantiation and I wasn't looking for this issue because the object is a file wrapper. After eliminating the file as perpetrator, while I was expecting a 92 type error, I wasn't expecting this as I wouldn't have thought it possible. (The mistake obviously! )
In the Class Def, one of the functions had a trailing comma in the arguments as shown below.
FUNCTION FieldByIndexList(KeyStart$,KeyEnd$,Where$,KeyNo,FieldIdx,FieldDelimiter$,)FIELD_BY_INDEX_LIST
This did not throw a line error in the *IT or on a load list in version 2017, only on instantiation.
Was getting file error 12 on an object instantiation and I wasn't looking for this issue because the object is a file wrapper. After eliminating the file as perpetrator, while I was expecting a 92 type error, I wasn't expecting this as I wouldn't have thought it possible. (The mistake obviously! )
In the Class Def, one of the functions had a trailing comma in the arguments as shown below.
FUNCTION FieldByIndexList(KeyStart$,KeyEnd$,Where$,KeyNo,FieldIdx,FieldDelimiter$,)FIELD_BY_INDEX_LIST
This did not throw a line error in the *IT or on a load list in version 2017, only on instantiation.
84
Nomads / configuring font in Parrallels
« on: August 23, 2019, 02:03:56 PM »
My font calculation is fine in windows, but nomads panels are too large in Parallels so that the window can exceeds the screen size calculated by the DEC($00$+MID(_X$,29,2))
Have determined that a parallels server is hosting the display and I am picking up that resolution for font sizing.
Is there a way to identify when a nomads window will display in Parallels?
Is there a way to get the final client from Parallels?
Have a great weekend.
Have determined that a parallels server is hosting the display and I am picking up that resolution for font sizing.
Is there a way to identify when a nomads window will display in Parallels?
Is there a way to get the final client from Parallels?
Have a great weekend.
85
Nomads / Re: Cannot remember how folders work in Object Nomads.
« on: July 31, 2019, 09:01:01 AM »
Thanks Mike,
Suspecting a refresh issue, I had traced the logic in debug mode from the read to the folder display. After the read, the variables for the second folder were populated, and after clicking the tab to display for the first time, they were not. To keep the project moving I saved off the folder panels and made one screen so there is no going back for a quick test now.
The system parameters do have Thoroughbred compatibility set.
Could all be from the need of a server reboot too since I am seeing the occasional quirks.
Yesterday and today for instance, an inherited class on this panel started running the panel keyinit rather than its own method and wiping out the key value. This code was tested a couple days after starting this thread and has just worked since. To correct, I needed to go back and add "from 'This class'" to all the inherited base class method instances. A first for me.
Suspecting a refresh issue, I had traced the logic in debug mode from the read to the folder display. After the read, the variables for the second folder were populated, and after clicking the tab to display for the first time, they were not. To keep the project moving I saved off the folder panels and made one screen so there is no going back for a quick test now.
The system parameters do have Thoroughbred compatibility set.
Could all be from the need of a server reboot too since I am seeing the occasional quirks.
Yesterday and today for instance, an inherited class on this panel started running the panel keyinit rather than its own method and wiping out the key value. This code was tested a couple days after starting this thread and has just worked since. To correct, I needed to go back and add "from 'This class'" to all the inherited base class method instances. A first for me.
86
Nomads / Re: Cannot remember how folders work in Object Nomads.
« on: July 26, 2019, 12:14:01 PM »
Mike,
Version is 1400-664.
Version is 1400-664.
87
Nomads / Cannot remember how folders work in Object Nomads.
« on: July 24, 2019, 09:15:52 AM »
Hi list,
Tried adding a two panel folder to an object nomads panel yesterday and could not get the second panel to load the data (iol variables in fields) unless it was visible when when the record was pulled up. Illogically, in that case, the first panel had its data as well, and both panels kept their data while flipping back and forth and navigating other records then returning.
Really seems like the second panel clears the record variables on it when first shown, but first panel does not, even when displayed second.
After sleeping on it I am still mystified. What am I doing wrong? Is it necessary to make the last panel the current panel prior to reading a record and switch back? Fldr'DisableFldr() until after the read?
Background:
V17. Not using RefreshScrn( ) as it does not work for the main panel.
Key and navigation Btns use same logic from record read which is by record.
Record data is moved to screen variables, which is iol list.
Tried adding a two panel folder to an object nomads panel yesterday and could not get the second panel to load the data (iol variables in fields) unless it was visible when when the record was pulled up. Illogically, in that case, the first panel had its data as well, and both panels kept their data while flipping back and forth and navigating other records then returning.
Really seems like the second panel clears the record variables on it when first shown, but first panel does not, even when displayed second.
After sleeping on it I am still mystified. What am I doing wrong? Is it necessary to make the last panel the current panel prior to reading a record and switch back? Fldr'DisableFldr() until after the read?
Background:
V17. Not using RefreshScrn( ) as it does not work for the main panel.
Key and navigation Btns use same logic from record read which is by record.
Record data is moved to screen variables, which is iol list.
88
Programming / Re: How to remove a file from an FTP server using Curl
« on: June 20, 2019, 04:27:29 PM »
Mike,
I recently ran into a hosted ftp curl delete issue and the answer was to put a ./ before the filepath.
I recently ran into a hosted ftp curl delete issue and the answer was to put a ./ before the filepath.
89
Nomads / Re: using code snippets for standard control definitions
« on: May 24, 2019, 08:53:52 AM »Another way to see all the lines and change them quickly is to export a similar panel and change the "INI" like text, and then reimport as the new panel. Down side is you leave text files on the system that have to be transferred and cleaned up. Occasionally it fails as well. But it was a major time saver for years.
I also use clip and snip nomads libraries, but when working around different systems you get burned by less obvious things like validations unless you examine every folder on every field. Yesterday I copied a dictionary field and lost the time saving and more in the testing phase.
After playing with Thomas's method yesterday, I realized it is a superior method, and is going to save me a lot of headaches and heartaches.
Thanks Thomas.
90
Nomads / Re: ERR=10 *nomads /pvx/lib/*winproc - Line 230
« on: May 24, 2019, 08:36:09 AM »
Something to keep in mind when working with Nomads
Nomads creates a shadow copy of the panel you are working on (if none exists) by doing AND $80$ on the first character of every key for the panel. You are working with the shadow copy until the panel is saved or abandoned.
A good example of this is to shift insert on a field, then paste into a text editor. The record will start with a special character, not the one you were expecting and the asc() will be 128 higher.
So when you open a panel and on exit after no changes and get the messages save and abandon, the shadow record still exists because someone did not abandon their changes however many years earlier.
Nomads creates a shadow copy of the panel you are working on (if none exists) by doing AND $80$ on the first character of every key for the panel. You are working with the shadow copy until the panel is saved or abandoned.
A good example of this is to shift insert on a field, then paste into a text editor. The record will start with a special character, not the one you were expecting and the asc() will be 128 higher.
So when you open a panel and on exit after no changes and get the messages save and abandon, the shadow record still exists because someone did not abandon their changes however many years earlier.