PxPlus User Forum

Twitter Twitter Twitter

Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
Nomads / Re: Convert NOMADS file to XML (need IOLIST)
« Last post by Loren Doornek on March 13, 2024, 03:32:35 PM »
Search for "IOL=" in *winproc.dsp.  It is most likely line 8010 that has the IOList.

8010 IOLIST _obj_nme$,_obj_c,_obj_l,_obj_w,_obj_h,_obj_type$,init_text$,init_val$,_obj_tab,_obj_def$,_obj_dsp$,_obj_fcs$,_obj_sel$,_obj_msg$,_obj_hlp$,_obj_attr$,_obj_idx$,_obj_hotkey$,_obj_qry$,_obj_sec$,_obj_sts$,_obj_grp$,_obj_null$,_obj_tag$,_obj_tbl$,_obj_inp$,_obj_out$,_obj_valid$,_obj_class$,_obj_tip$,_obj_orig$,_obj_font$,_obj_color$,_obj_listbox_type$,_obj_sep$,_obj_scratch$,_obj_popup$,_obj_sizing$,_obj_logic1$,_obj_logic2$,_obj_popup_logic$,_obj_qry_bitmap$,_obj_qry_width,_obj_qry_tip$,_obj_qry_attr$,_obj_extension$,_obj_demand$,_obj_demand_logic$,_obj_background_logic$,_obj_persistence$,_obj_notes$,_obj_tbl_len,_obj_tvline_color$,_obj_autosz_width$,_obj_autosz_height$,_obj_automation_text$,_obj_hilight_colors$,_obj_props$,_obj_visual_class$
32
Nomads / Convert NOMADS file to XML (need IOLIST)
« Last post by pwhirley on March 13, 2024, 03:13:51 PM »
I am writing a utility to convert PVXPlus program and library files to text so that Beyond Compare (a compare utility from Scooter Software) can easily spot changes.  Converting the program to text is easy and done.  I've decided to convert the NOMADS library files to XML.  I can do this with made-up column names (i.e. Field1, Field2, etc), but I'd rather have the meaningful names that go with the columns.

Have any of you already written a conversion of NOMADS library files to XML that you'd be willing to share?

Where would I find the IOLIST for a NOMADS library file?

Thanks - Phil

P.S. I'll be happy to share my conversion program and the Beyond Compare configuration to anyone interested.  It's quite useful.
33
Programming / Re: accessing mySQL-DB
« Last post by EVa on March 13, 2024, 11:57:13 AM »
I'm running CentOS8, my MariaDB library version is:

libmariadb.so.3-3.1.11-2.el8_3.x86_64

Your program codes works without an error in v20.10 (64-bit).
34
Programming / accessing mySQL-DB
« Last post by Thomas Bock on March 13, 2024, 11:19:19 AM »
We encounter problems with a newer version of libmariadb.so.3
PxPlus 20.10 is installed on a Linux server.
The program below runs with version 3.1.13 on a Linux server. With version 3.2.7 the result is empty and msg(-1) returns "MYSQL:0:".
Code: [Select]
begin
dbOpt$ = "SERVER=my_server;USER=my_account;PASSWORD=my_password;DATETIME_CONVERT=N"
dbName$ = "[MYSQL]my_database;;"
channel = hfn
open (channel, OPT = dbOpt$, tim = 10) dbName$
query$ = "SELECT * FROM `myTable` limit 1"
write record (channel)query$
gosub buildPVXIOList
repeat
read record(channel,err=*next)sqlResultItem$
if tcb(2) {
print msg(err)
print msg(-1)
break
}
print ++c,": ",sqlResultItem$
until 0
close( channel)
end
buildPVXIOList:
local sqlIOL$    = ken(channel, ind = 3)
local pvxIOL$    = "IOLIST "
local separator$ = $$
local items      = pos(";" = sqlIOL$, 1, 0)
local counter    = 0
local virtual    = 0
repeat
fieldDefinition$ = arg(sqlIOL$, counter + 1, ";")
read data from fieldDefinition$, sep = "," to fieldName$, fieldType$
fieldName$  = tbl(nul(fieldName$), fieldName$, "_VIRTUAL" + str(++virtual))
pvxIOL$    += separator$ + fieldName$
if (mid(fieldType$, 1, 3) = "CHR") or (fieldType$ = "DATE") {
pvxIOL$ += "$"
}
separator$ = ","
until (++counter > items)
pvxIOL$ = sub(pvxIOL$, "-", "_")
dim sqlResultItem$ : cpl(pvxIOL$)
return

What needs to be done in order to work with then newer version?
35
Programming / Re: creating UTF-8 text file
« Last post by Alain Stucki on March 10, 2024, 04:55:22 PM »
 :)
Hello
Thank you sooo much for your fast reply. This works great!
36
Programming / Re: creating UTF-8 text file
« Last post by Allen Miglore on March 10, 2024, 10:43:05 AM »
37
Programming / creating UTF-8 text file
« Last post by Alain Stucki on March 10, 2024, 05:19:57 AM »
Hello. I'm trying to get our product data into a CSV-file and use this to import our data into a webshop. So I OPEN LOCK (7)"datafile.csv" and then I PRINT the requried data into that csv-file.

That works fine. I can open the file with Windows Editor and everything looks good. But when I import the file into the webshop, the accented characters look weird.So the problem is the codepage . The shop requires UTF-8 file format. And the file my little program has created is ANSI. So my questions is: How can I create UTF-8 text files (no BOM) or would I need to use a CLI tool to convert the file from ANSI to UTF-8?

Best regards
Alain Stucki
38
iNomads / Re: File Upload
« Last post by Mike King on March 09, 2024, 02:00:30 PM »
My suggestion would be to upload to a temporary directory then check the file size and contents using a virus scan and only then copy it to the proper location.

Technically there is no 'sure fire' way to control what the user is uploading.  For example while you might want to restrict a user to only upload a JPG or PNG, they could simply rename a infected file to have a .png or .jpg suffix.  Only once the file is uploaded can you confirm its contents. 

For JPG, PNG and BMP files you can read the first few bytes of the uploaded file to confirm the file type, then run whatever anti-virus software you want on the file before accepting it.  For example if you use Avast as your anti-virus the command ashCmd.exe can be used to scan a specific file and report its findings.
39
iNomads / File Upload
« Last post by bteixeira on March 08, 2024, 04:57:18 PM »
Looking into allowing users to upload some files but worried that there seems little control.  Is there any way to limit the files a user can upload based on file type and/or size?  %inomads'upload_file doesn't seem to have any limitations.  I'm planning on saving the file to a directory and run a command line virus scan on it, but it would be better if I could do that on the web server and then move the approved file to the application server after it's been scanned.  Is there any way to put the upload file in the session's tmp directory or something?
Thanks.
40
Web Services / Re: Publishing a PDF through PXPlus web engine
« Last post by pwhirley on March 08, 2024, 08:27:01 AM »
Thanks Mike,
That's too easy.  :-)

The piece I was missing is the %Content-type$ global variable.  I'm sure there are many other variables used by the web engine that I don't know about.

I appreciate the help.

- Phil
Pages: 1 2 3 [4] 5 6 ... 10