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 - RobL

Pages: [1] 2
1
Language / Re: Load Edit Keys 'EL'
« on: July 01, 2021, 02:18:49 PM »
Hi Skip,

Does the following work for you?

begin
print 'EL',"2",chr(9),$02$,"Y"+$0D$,
input "Do you wish to continue?: <Del>='Y': ",answer$
print "You entered ",answer$

I tried this on PxPlus 17.10 Windows and it seems to work correctly.

Regards,

Rob Leighton
Riverwood Enterprises Inc.

2
Nomads / Re: Displaying an Excel spreadsheet on a NOMADS panel
« on: June 06, 2021, 03:22:59 PM »
Hi St├ęphane,

Thank you for the reply! You've given me somewhere new to start looking/Googling.

Regards,

Rob

3
Nomads / Displaying an Excel spreadsheet on a NOMADS panel
« on: June 04, 2021, 07:55:23 PM »
Hi All,

I'm trying to display an Excel spreadsheet within a COM control defined on a NOMADS panel. I have the COM Control defined as "Excel.Application". In the "PostCreate" logic contains the following code:

filename$=pth("2013-09-30.xlsx")
com_1.ctl'Workbooks'Open(filename$)
com_1.ctl'Visible=1


When I test the panel, Excel starts in a window behind the NOMADS panel and loads the specified file. I've also tried something similar outside of NOMADS, with the same result; Excel opens in a separate window.

begin
def object xl,@(2,2,60,40)="Excel.Application"
xl'Workbooks'Open(pth("2013-09-30.xlsx"))
xl'Visible=1
xl'Quit()


I found some code in my Mailing List archive that works using "Shell.Explorer" and PDF files, and optimistically hoped it would work in a similar fashion with Excel.

Is it possible to do this? Any nudges in the right direction would be greatly appreciated!!

Regards,

Rob Leighton
Riverwood Enterprises Inc.

4
Language / Re: Directory +INFO
« on: April 08, 2021, 05:36:28 PM »
Hi James,

That can happen if the file is a copy of another file. The copy of the file gets a new 'creation date', but keeps the original 'last modified' date.  That's what happens on Windows, not sure if it's the same on Linux.

Hope that helps!

Rob Leighton
Riverwood Enterprises Inc.

5
Programming / Re: converting providex to pxplus - *viewer*
« on: April 06, 2021, 12:01:50 AM »
Hi,

There is an issue with your test program. You should be seeing an Error 20 Syntax error on the first line (CHN=HFN...). CHN is a System Variable and can't be used in this manner (Here's a link to the documentation https://manual.pvxplus.com/PXPLUS/variables/chn.htm)

Try changing your test program to:

CHAN=HFN; OPEN (CHAN)"*VIEWER*"
PRINT (CHAN)"TEST VIEWER"
CLOSE (CHAN)

I tried the above on a Win10/64 machine with a Demo version of PxPlus 17.10 (latest release) and the viewer opened as expected.

Regards,

Rob Leighton
Riverwood Enterprises Inc.


6
Programming / Re: CLEAR vs CLEAR Composite string
« on: February 14, 2021, 05:10:58 PM »
Hi Mike / JR,

I played around with this a bit this weekend.

Format 2 of the CLEAR directive works the same as Format 1 when you specify a list of variables.

It will:
- reset PRECISION to the default value specified by the 'PD' parameter (2 is the default).
- clear the FOR/GOSUB/WHILE stack.
- clear the DATA (not the ATTRIBUTES) from the variable DIMensioned as a composite string.

When I run the following program...

begin
!
precision 10
!
cust:iolist custnum$,custname$,balance
dim cust$:iol=cust
cust.custnum$="123",cust.custname$="ABC Supply",cust.balance=456.78
!
print "default PRC: ",prm('PD'),'LF'
!
for 1
print "Before CLEAR"
print "precision: ",prc
print "cust$....: ",lst(iol(cust$))," - ",sub(cust$,sep,"|")
!
clear cust$
!
print 'LF',"After CLEAR"
print "precision: ",prc
print "cust$....: ",lst(iol(cust$))," - ",sub(cust$,sep,"|")
!
next

... I get the following results:

->run
default PRC:  2

Before CLEAR
precision:  10
cust$....: iolist custnum$,custname$,balance - 123|ABC Supply|456.78|

After CLEAR
precision:  2
cust$....: iolist custnum$,custname$,balance - ||0|
next
Error #28: No corresponding FOR for NEXT
Current program is D:\PxPlus\Projects\Default\rob1, line 24

I ran this test on PxPlus 2020 Ver 17.10 on Windows and PxPlus 2016 Ver 13.00 with the same result.

If you change 'cust$' to 'cust.custname$', only that field is cleared.

I think the docs are wrong. The DIM directive (Format 2 - Define Composite String) documentation states that "You can use the CLEAR directive to reset a variable that is defined as a string template". What is meant by 'reset' may be debatable, but the attributes are definitely not being cleared as stated on the CLEAR directive page.

I don't use the CLEAR directive (at least, not that I can remember). To clear the data from a composite string I use 'cust$=""', and to clear the attributes I use 'DIM cust$(0)'.

Also, something else to note: when using CLEAR, don't forget that CLEAR also affects REPEAT..UNTIL/SWITCH..END SWITCH/WITH..END WITH. I think that's the complete list...

Regards,

Rob Leighton

7
Language / Re: password protected data files
« on: October 12, 2020, 04:26:16 PM »
Hi Paula,

You could try opening the files with a dummy (or null) password and then process the returned error code. Here's an example;

begin
!
! create a file with no password
erase "FileNoPass",err=*next
keyed "FileNoPass",[1:1:10],0,0
!
open (1)"FileNoPass"
write (1)"test","some data"
close (1)
!
! create a file with a password
erase "FileWithPass",err=*next
keyed "FileWithPass",[1:1:10],0,0
!
open lock (1)"FileWithPass"
password (1)"secret" required for open and on data
write (1)"test","some data"
close (1)
!
! process list of files
for filename$ from "FileNoPass,FileWithPass,MissingFile,"
!
print "processing filename: ",filename$
!
filechan=unt; open input (filechan,key="",err=*next)filename$
if tcb(2) then if err=12 then print "   *** file ",filename$," is missing."
!
close (filechan)
!
next

Regards,

Rob Leighton

8
Programming / Re: Binary auto increment key
« on: October 09, 2020, 07:22:27 PM »
Hi Peter,

That's an interesting idea, but I think it has to do with type of auto-increment field being used. I tried creating a blank-filled and zero-filled auto-increment and those 2 types allowed the field to be initialized to either "" (null), " " (blank) or $00$. In all 3 cases the fields are part of an internal key.

Regards,

Rob


9
Programming / Re: Binary auto increment key
« on: October 09, 2020, 12:27:40 PM »
Hi Michael,

I'm no auto-increment key expert, but here's an example that seems to work correctly.

begin
!
! define the file
erase "testfile",err=*next
keyed "testfile",[0:1:4:"I"],0,-1000
!
testfile=unt; open (testfile,rec=testfile$,iol=testfile)"testfile"
testfile:iolist id$:[chr(4)],cust_num$,cust_name$
!
! write some data records
for recnum=1 to 5
testfile.id$=dim(4,$00$)
testfile.cust_num$=str(recnum:"000000")
testfile.cust_name$="Customer "+testfile.cust_num$
write (testfile)
next
!
! display records in file
select *,rec=testfile$ from testfile begin ""
print hta(kec(testfile))," - ",testfile.cust_num$," - ",testfile.cust_name$
input *; if ctl=4 then escape
next record

In Gords' post, he indicated that the variable containing the auto-increment must be blank, but I could only get it to work by filling it with $00$'s.

Hope this helps (and is correct!!)

Regards,

Rob Leighton

10
Programming / Re: Getting Text of a Program Line Number
« on: June 01, 2020, 12:37:04 PM »
Hi Jeffrey,

Take a look at the utility program "*pg.cnv". It can be used to convert a program file to a text file (and vice versa).

Regards,

Rob Leighton

11
Programming / Re: Selecting all list_box entries
« on: September 19, 2019, 01:02:13 AM »
Hi James,

I found the following in an email posted by Mike King (dated 12/03/2007) on the old PxPlus Mailing List.

<snip>
If you happen to be using PxPlus use the FIND option to read all the values then issue a WRITE to enable them.

For example:

0010 LIST_BOX 10,@(10,5,40,10),OPT="#"
0020 FOR I=1 TO 50
0030 LIST_BOX LOAD 10,0,STR(RND(10000):"0000")+STR(RND(10000):"0000")
0040 NEXT I
0050 LIST_BOX FIND 10,0,X$
0060 LIST_BOX WRITE 10,X$
0070 ESCAPE

The FIND on line 50 gets a string containing all the values, then you can write this back to the control in order to select all the items.

... so basically all you need to do is:

LIST_BOX FIND 10,0,X$
LIST_BOX WRITE 10,X$
</snip>

Is that what you're looking for?

Regards,

Rob Leighton
Riverwood Enterprises Inc.

12
Hi Mike,

I see my error. Thanks!

But... when I was trying to figure out if the issue was on my end, I tried doing an online update to PxPlus 2016 and PxPlus 2017 and I got the same "Unable to connect..." error message. However, I've just tried updating them again, and now I'm receiving the expected "There are no updates available..." message.

Regards,

Rob

13
Hi,

A message box containing the message "Unable to connect to the update server to obtain patch list" is displayed when I try to apply the September 2019 update to PxPlus 2019.

Can someone point me in the right direction to correct this issue?

Thanks in advance!

Rob Leighton
Riverwood Enterprises Inc.

14
Language / Re: XEQ() question
« on: September 11, 2018, 12:32:08 PM »
Hi Mike,

You are correct! It can be eliminated. There was a reason at the time, but not anymore. Thanks for the second look!

Regards,

Rob

15
Language / Re: XEQ() question
« on: September 10, 2018, 12:04:16 PM »
Chris:

Using a unique variable name is the approach I used in the past that I'm trying to avoid. Normally, I'd just use global functions, but in this instance I'm trying to create a standalone module that will have zero impact on the existing codebase.

There aren't alot of these functions, but they are used throughout this module. In some timing tests I did, using XEQ / CALL performed as quickly as global functions, and a nice side benefit is you can single-step through the code when debugging. I even thought about using objects, but that seems like overkill...
 
Mike:
Thanks! #1 is the obvious answer (now that you've pointed it out) and #2 will come in handy for something else!

Regards,

Rob

Pages: [1] 2