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.


Topics - Mike Hatfield

Pages: [1] 2
1
Programming / Spawning a session
« on: Today at 01:34:40 AM »
Hi All, I'm running a plus/cs windx session.
I want to be able to open a new window/session from the current program.
In that new window I want to have it run a program that will display some lines of customer information text. When I find the text I want to switch back to the calling windx session and be able type in some of the text. When I'm done I want to close the new window/session either by clicking on the new session 'x' or issuing a close/drop or whatever in the calling program.
 
Would you believe in the nearly 26 years of programming with Pvx/PxPlus I've never had occasion to do this.
Is this accomplished by spawning a session or is there an easier way. I did do a test with *plus/cs/spawn. It gives me a new session window but none of the global variables from the calling application.
If this is the correct approach how would I place the following in the spawn argument cmdline   -  PROCESS "ARCM_INFO",%PATH_ROOT$+"dictionary/SM_CZ.EN",R2$

I don't seem to be able to do this with a dialogue window. IE Once inside the dialogue window you can't swith back and forth between the dialogue and calling program.

Thanks

2
ODBC / Dictionary definition for dates in YYMMDD format
« on: March 06, 2023, 01:23:03 AM »
We are working on a legacy system that has dates stored in the format YYMMDD.
We are trying to use ODBC with Excel to extract from the file with a criterium based on date EG select dates <= 30/06/22
What is the correct definition in the data Dictionary so that you can select by date in ODBC (EG 30/06/22).
Would we create a Date Class and apply that to the element and if so, how?

Thanks
Mike Hatfield

3
ODBC / Updating a file from EXCEL PxPlus SQL Server
« on: October 18, 2022, 06:23:06 PM »
I've created a test in our PxPlus SQL Server permissions setup for RW for any user and any company.
I've chosen a file and fields from the ODBC selection and now it is displayed in Excel.
What is required to have Excel write back to the file when you change a cell in the workbook.
Thanks

4
Thin Client/WindX / Simple CS Client on V17
« on: May 01, 2021, 11:39:14 AM »
We have been using Simple CS Host and Client since it was introduced.
However I simply cannot get it to work with V17
Windows Server 2016 and Windows server 2019.
On the Server 2016 we have V16 installed in ...HIT\pvx and the Simple Client service running..
We've installed V17 in ..HIT\pvx17 and cloned the application icons, stopped the V16 service, started the V17 host from the desktop and changed the start folders in the application start icons.
I see the client screen flash up on the desktop and it dies straight away.

On the Server 2019 we've installed V17 into ..HIT\pvx and setup the service and created the icons the same as our V16 server.
when I try to start the application I see the same client flash on the screen and the client dies.

I am thinking there is a difference in V17 from V16, but what....?

If I start the V17 host on the desktop from the Pxplus start menu I can start the simple client from the start menu.

Clearly I am missing something here, but what?

Thanks





5
Registration and Setup / Installing in Azure Windows Virtual Desktop
« on: September 06, 2020, 10:48:41 PM »
We are going to do a trial migration for a small end user (only three users) to Azure Windows Virtual Desktop.
I wonder has anyone done this yet or have any experience or tips?
We are going to test in the 'Hosted Pool' environment first.
If that is not successful then we will test in the individual desktop environment.

Thanks

6
ODBC / Writing to data file from PxPlus ODBC in Excel
« on: May 08, 2020, 02:59:41 AM »
Hi All,

I remember a few years ago that I worked out how to use the ProvideX ODBC to update a Providex file from Excel.
1. Populate Excel using the Providex ODBC from dictionary defined file.
2. Modify a cell and then write that row back to the ProvideX file.
3. Delete a row and that 'record' would be deleted from the ProvideX file

I just can't remember what the ProvideX ODBC configuration was to achieve this.

Has anyone done this and care to share?

Thanks

7
Nomads / How to exit a panel with an <Enter> key
« on: January 29, 2020, 01:39:09 AM »
hi Folks,

A really, really dumb question.....
I have a really simple panel. All it does is display an image in the Pre-Display logic
All I want to do is have the panel close when I press the <ENTER> key.
Currently it only closes on <F4>
Normally I'd have an Exit or Close button or <F4> to close the panel.
Never wanted to do this before.

00110 PREDISPLAY_ICNQ_PICTURE:
00120 LET S$=ARG_1$
00130 LET IC_PHOTO=HFN
00140 LET STK_PHOTO$=%PATH_DATA$+"ic_images/"+CVS(S$(1,25),3)+".png"
00150 OPEN (IC_PHOTO,ERR=*NEXT)STK_PHOTO$; GOTO 0170
00160 LET STK_PHOTO$=%PATH_DATA$+"ic_images/noimage.png"
00170 CLOSE (IC_PHOTO)
00180 RETURN

Thanks
 

8
Hi

Ubuntu latest version
PxPlus 10 64 bit

What is the procedure to install ssl library libssl.so.10
Thanks

9
Programming / JSON files
« on: August 22, 2019, 11:45:24 PM »
Hi All,

When I create JSON files from PxPlus each element terminates with comma+0A.
I note that most JASON files we process from other sources are a continuous stream of data with only a comma between elements.
If I parse the PxPlus file at https://jsonformatter.org/ is validates OK.

Is this correct for PxPlus or should I be doing something to eliminate the 0A ?

SMPRICE_JSON:
CLEAR SMPRICEJSON${ALL}
LET SMPRICEJSON$["Price Date"]=""
LET SMPRICEJSON$["Products.1.Inventory_SKU"]=""
LET SMPRICEJSON$["Products.1.List_Price"]=""

LET SMPRICEJSON$["Price Date"]=DYMD$
FOR I=1 TO 5
READ RECORD (ICM1)ICM1$
LET SMPRICEJSON$["Products."+STR(I)+".SKU"]=ICM1.STOCK_CODE$
LET SMPRICEJSON$["Products."+STR(I)+".Price"]=STR(ICM1.PRICES[1])
NEXT I
LET SMPRICE$=DIM(LIST EDIT SMPRICEJSON${ALL})
LET JSONFILE$="/hit/temp/czapijson.json";
       ERASE JSONFILE$,ERR=*PROCEED;
       SERIAL JSONFILE$;
       OPEN (HFN,ISZ=LEN(SMPRICE$))JSONFILE$;
       WRITE RECORD (LFO)SMPRICE$;
       CLOSE (LFO)

Thanks

10
Programming / Writing CSV files
« on: July 02, 2019, 11:06:27 PM »
Hi all

I have to read a csv file, update the 6th column and write the record out again.
I know I could do this with a call to Excel but I can't remember how to do it. I think it would also be very slow.
So, instead I'm reading the input CSV, updating the 6th column and writing it out to a new CSV file.
This is great except the new file has quotes around each column.
How do I write the record without the quotes?

Thanks

00015  DIM CSVREC$[1:7]
00016  IOLIST CSVREC${ALL}:[STR(",")]
00021  OPEN (2)"/HIT/TEMP/CUSTOMER.CSV"
00022  LET CUSTOMEROUT$="/HIT/TEMP/CUSTOMEROUT.CSV"
00023  ERASE CUSTOMEROUT$,ERR=*NEXT
00024  SERIAL CUSTOMEROUT$
00025  OPEN LOCK (3)CUSTOMEROUT$
00030  READ (2,END=0500)IOL=0016
00032  CSVREC$[6]=123456"
00034  WRITE (3)IOL=0016

This becomes
name@gmail.com,base,default,David,Chard,,

this
"name@gmail.com","base","default","David","Chard","123456","",


11
Programming / How to remove a file from an FTP server using Curl
« on: June 05, 2019, 08:34:11 PM »
Hi All,

We have written our code to access a Magento FTP Server using CURL to download orders from a folder in json format.
To avoid processing the same orders I need to remove the file from the Magento FTP server as we process it.
That remove command structure is eluding me.
Has anyone removed a file from an FTP Server?
Thanks

12
Web Services / Curl Syntax
« on: May 22, 2019, 09:50:00 PM »
I am trying to specifiy the folder to download a file using Curl FTP
It uses the current folder by default.
I have trawled all the online doco but I cant find the syntax to specify the local destination.

LET MPROGRAM$="""\hit\pvx\curl.exe""",MDESTINATION$="ftp://ftp.hatfields.com.au/public_html/Future/Texts/"+TT$,MUSER$=%NW_WEB_USER$+ \
             ":"+%NW_WEB_PASSWORD$

LET SS$=MPROGRAM$+" -k --ssl -O """+MDESTINATION$+""" --user """+MUSER$+"""       "
INVOKE WAIT SS$

The above becomes:


"\hit\pvx\curl.exe" -k --ssl -O "ftp://ftp.domain.com.au/public_html/Future/Texts/mytestfile.txt" --user "username:password"

1. What is the syntax to specify the destination on the local computer?
I assume it's possible because *web/ftp can do it.
Unfortunately *web/ftp won't work with the new certificate requirements on ftp server. You always get an error.
I've had that discussion before, hence using Curl. The -k and --ssl parameters overcome the certificate issue.

2. Is there a syntax to specify all eg   *.txt files on the ftp server to download.
Again I can't find that either.
I did find ranges eg   [100-200].txt but that won't work in my case because the files names could be random.
I have resorted to retrieving a file ( ?.txt ) from the ftp server folder and parsing that for individual files.
 
Thanks

13
Programming / CLEAR vs CLEAR Composite string
« on: May 15, 2019, 05:47:28 AM »
I know what CLEAR does to the program space.
I think the documentation is a bit ambiguous for CLEAR composite string
I can't see any difference in the two forms.
I interpreted CLEAR composite String to ONLY clear the Composite string but it CLEARS the stack as well

CLEAR
CLEAR MORDER${all}
Both clear the for/next/gosub stack
Is this correct?
If so, what is the point of having a separate format 2?

14
Programming / Reading/parsing JSON data
« on: May 15, 2019, 02:12:35 AM »
This is the  JSON Data file supplied

 "Order ID": "000000034",
  "Grand Total": "6",
  "Sub Total": "5.45",
  "Shipping Method": "flatrate_flatrate",
  "Shipping Description": "Order below FIS value - freight to be advised",
  "Payment Method": "Bank Transfer Payment",
  "Billing Details": {
    "City": "Springfield Lakes",
    "Street": "Brisbane",
    "Post Code": "4064",
    "Telephone": "123456789",
    "RegionCode": "Queensland"
  },
  "Shipping Details": {
    "Shipping City": "Springfield Lakes",
    "Shipping Street": "Brisbane",
    "Shipping Post Code": "4064",
    "Shipping Telephone": "123456789",
    "Shipping RegionCode": "Queensland"
  },
  "Customer Details": {
    "First Name": "Test",
    "Last Name": "Maybray",
    "Email": "test234@maybray.com",
    "IP": "144.130.97.53",
    "ID": "412"
  },
  "Products": [
    {
      "ID": "",
      "Name": "9\" x 7\" CLEAR BOOK COVER WITH COLOURED RETURNS - PACK OF 5 - BC97",
      "Type": "simple",
      "Qty": "1",
      "Price": "1.95"
    },
    {
      "ID": "",
      "Name": "SCRAPBOOK COVER - CLEAR - PACK OF 5 - SBC4934",
      "Type": "simple",
      "Qty": "1",
      "Price": "3.5"
    }
  ]
}

My Code snippet below with json as read from file.
What am I doing wrong? How do I access the fields?
My task is to parse the file and create the order in the PxPlus application order file.

  OPEN (HFN,ISZ=10240)"/hit/temp/000000034.json"
  READ RECORD (LFO,ERR=*NEXT)TEMPJSONORDER$;
  LET JSONORDER$+=TEMPJSONORDER$;
  GOTO *SAME
 !
  ESCAPE !
  DIM LOAD MORDER${ALL}=JSONORDER$
 !
  PRINT MORDER$["Order ID"]
 ! This  returns nothing at all



1}? jsonorder$
{"Order ID":"000000034","Grand Total":"6","Sub Total":"5.45","Shipping Method":"
flatrate_flatrate","Shipping Description":"Order below FIS value - freight to be
 advised","Payment Method":"Bank Transfer Payment","Billing Details":{"City":"Sp
ringfield Lakes","Street":"Brisbane","Post Code":"4064","Telephone":"123456789",
"RegionCode":"Queensland"},"Shipping Details":{"Shipping City":"Springfield Lake
s","Shipping Street":"Brisbane","Shipping Post Code":"4064","Shipping Telephone"
:"123456789","Shipping RegionCode":"Queensland"},"Customer Details":{"First Name
":"Test","Last Name":"Maybray","Email":"test234@maybray.com","IP":"144.130.97.53
","ID":"412"},"Products":[{"ID":"","Name":"9\" x 7\" CLEAR BOOK COVER WITH COLOU
RED RETURNS - PACK OF 5 - BC97","Type":"simple","Qty":"1","Price":"1.95"},{"ID":
"","Name":"SCRAPBOOK COVER - CLEAR - PACK OF 5 - SBC4934","Type":"simple","Qty":
"1","Price":"3.5"}]}
1}

1}? morder${all}
00000003465.45flatrate_flatrateOrder below FIS value - freight to be advisedBank
 Transfer PaymentSpringfield LakesBrisbane4064123456789QueenslandSpringfield Lak
esBrisbane4064123456789QueenslandTestMaybraytest234@maybray.com144.130.97.534129
" x 7" CLEAR BOOK COVER WITH COLOURED RETURNS - PACK OF 5 - BC97simple11.95SCRAP
BOOK COVER - CLEAR - PACK OF 5 - SBC4934simple13.5
1}

15
Thin Client/WindX / NTHOST Service on a Windows 10 PC
« on: May 12, 2019, 11:54:35 PM »
Hi All,
We have a reseller that has a number of end users that use a Windows 10 PC as the 'server' with NTHOST running as a service.
They report that when Windows does an automatic update they have to delete the service and re-install it.
I've not had heard of this.
Is there any feedback on this issue?
Thanks

Pages: [1] 2