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.
166
Programming / Generic Query
« on: March 07, 2019, 04:35:30 PM »
Hello List,
I tend to always run into these one off situations where I need user input from a list
but the data is not in a file and too many selections for a message box.
and i dislike making a panel for each instance....
so i had this idea for a generic query routine that i could
pass in an associative array
and get a return value
============================================
here is my code ...it is almost working but i dont think i have the OBTAIN right
and the arrows are not working on the list box.....
has anyone ever done this?
can someone help me out
29000 !
29010 GENERIC_QUERY:
29020 enter (PANEL_TITLE$),ARRAY${all},RETURN_VALUE$
29030 if dim(read num(ARRAY$))=0 then exit ! If No Values then Exit
29040 call "CAIREPOS;PRINT_CENTERED_DIALOGUE",50,35,(PANEL_TITLE$) ! This is just my routine to Print a Centered Window (this part works)
29050 let LOAD_THIS$=""
29060 for ARRAY_INDEX$ index ARRAY${all}
29070 let LOAD_THIS$+=ARRAY_INDEX$+sep
29080 next
29090 list_box 100,@(1,1,48,33),fnt="*"
29100 list_box load 100,LOAD_THIS$
29120 list_box write 100,1,err=*next
29121 let NEXT_ID=100
29130 wait .5
29140 repeat
29150 obtain (tim=2)NIU$
29160 let MODE$=""
29170 list_box read 100,RETURN_VALUE$,MODE$,err=*next
29180 until MODE$=$0D$ or MODE$=$02$
29190 print (0,err=*next)'pop',
29990 exit
I tend to always run into these one off situations where I need user input from a list
but the data is not in a file and too many selections for a message box.
and i dislike making a panel for each instance....
so i had this idea for a generic query routine that i could
pass in an associative array
and get a return value
============================================
here is my code ...it is almost working but i dont think i have the OBTAIN right
and the arrows are not working on the list box.....
has anyone ever done this?
can someone help me out
29000 !
29010 GENERIC_QUERY:
29020 enter (PANEL_TITLE$),ARRAY${all},RETURN_VALUE$
29030 if dim(read num(ARRAY$))=0 then exit ! If No Values then Exit
29040 call "CAIREPOS;PRINT_CENTERED_DIALOGUE",50,35,(PANEL_TITLE$) ! This is just my routine to Print a Centered Window (this part works)
29050 let LOAD_THIS$=""
29060 for ARRAY_INDEX$ index ARRAY${all}
29070 let LOAD_THIS$+=ARRAY_INDEX$+sep
29080 next
29090 list_box 100,@(1,1,48,33),fnt="*"
29100 list_box load 100,LOAD_THIS$
29120 list_box write 100,1,err=*next
29121 let NEXT_ID=100
29130 wait .5
29140 repeat
29150 obtain (tim=2)NIU$
29160 let MODE$=""
29170 list_box read 100,RETURN_VALUE$,MODE$,err=*next
29180 until MODE$=$0D$ or MODE$=$02$
29190 print (0,err=*next)'pop',
29990 exit
167
Programming / Re: JSON to Array
« on: February 28, 2019, 11:36:49 AM »
A Coworker of mine just pointed out that I missed this in the documentation:
DIM LOAD array_name${ALL} = JSON_value$
sorry about that.
DIM LOAD array_name${ALL} = JSON_value$
sorry about that.
168
Programming / JSON to Array
« on: February 28, 2019, 10:58:38 AM »
Hi All,
I know we can take a PxPlus Associative Array and convert it to JSON.
I'm struggling with the inverse.
How do I parse JSON passed back via PxPlus.
Is it possible using PxPlus?
jeff
I know we can take a PxPlus Associative Array and convert it to JSON.
I'm struggling with the inverse.
How do I parse JSON passed back via PxPlus.
Is it possible using PxPlus?
jeff
169
Programming / Re: Defining Function
« on: February 25, 2019, 12:54:59 PM »
This looks promising James. I will give it a try. Thank you.
170
Programming / Defining Function
« on: February 25, 2019, 11:51:13 AM »
Hello List,
I'm trying to avoid using a global function but I would like function available in multiple programs. I tried doing the following:
PROG01
10 perform "PR0G02;DEFINE_FUNCTIONS"
20 PRINT fnPAIR$("Key","Value")
but I can't access the function defined in PR0G02
is my only recourse a Global Function?
jeff
I'm trying to avoid using a global function but I would like function available in multiple programs. I tried doing the following:
PROG01
10 perform "PR0G02;DEFINE_FUNCTIONS"
20 PRINT fnPAIR$("Key","Value")
but I can't access the function defined in PR0G02
is my only recourse a Global Function?
jeff
171
Programming / Re: Multi Line Dash
« on: February 21, 2019, 02:01:16 PM »
thanks Mike.
I figured was standard behavior but I just thought I would ask.
jeff
I figured was standard behavior but I just thought I would ask.
jeff
172
Programming / Multi Line Dash
« on: February 21, 2019, 11:22:19 AM »
Hello
I have a multi line that contains a description that contains dimensions as follows:
Blue Widget 35-7/8x79-3/8
what happens in the multi-line is that it sees the dash as an allowable place to split up a word
so it will do something like this:
===============
Blue Widget 35-
7/8x79-3/8
===============
if i change the - to anything else it seems to keep it together...
do i have any way around this aside from changing the dash to something else?
jeff
I have a multi line that contains a description that contains dimensions as follows:
Blue Widget 35-7/8x79-3/8
what happens in the multi-line is that it sees the dash as an allowable place to split up a word
so it will do something like this:
===============
Blue Widget 35-
7/8x79-3/8
===============
if i change the - to anything else it seems to keep it together...
do i have any way around this aside from changing the dash to something else?
jeff
173
Programming / Re: pxplus/web/request curl -k
« on: February 20, 2019, 09:20:22 AM »
Thanks for the feedback Mike. I think the issue might be the ip address is not whitelisted because I couldn't get curl to work on the server. I was testing curl on my desktop before I put on server.
174
Programming / pxplus/web/request curl -k
« on: February 19, 2019, 04:37:20 PM »
Hello
i'm trying to use pxplus web request.
my code wasnt working 403 Forbidden.
to test my code i used curl and to get it to work i had to use the -k flag
is there any equivalent to this curl -k that i can use in pxplus web request
or should i just use curl
thanks
jeff
i'm trying to use pxplus web request.
my code wasnt working 403 Forbidden.
to test my code i used curl and to get it to work i had to use the -k flag
is there any equivalent to this curl -k that i can use in pxplus web request
or should i just use curl
thanks
jeff
175
ODBC / Re: Extract on ODBC Sql Server
« on: August 22, 2018, 03:24:46 PM »
Devon,
I'm sorry I was just about to update my post.
A co-worker had me add:
[ODBC]
NONULLS=P
EXTROPT=$ FOR UPDATE
into the ini file and it works now.
jeff
I'm sorry I was just about to update my post.
A co-worker had me add:
[ODBC]
NONULLS=P
EXTROPT=$ FOR UPDATE
into the ini file and it works now.
jeff
176
ODBC / Extract on ODBC Sql Server
« on: August 22, 2018, 02:45:52 PM »
I was opening up a MS SQL Server table with [ODB].
Out of habit I tried to do an extract before writing a record and I received the following error:
msg(-1) = for update clause allowed only for declare cursor.
Does anyone have any idea what this is?
I ended up just doing a read/write and that worked.
Should I not bother with EXTRACTS on [ODB]SQL
Out of habit I tried to do an extract before writing a record and I received the following error:
msg(-1) = for update clause allowed only for declare cursor.
Does anyone have any idea what this is?
I ended up just doing a read/write and that worked.
Should I not bother with EXTRACTS on [ODB]SQL
177
Language / Re: text/html encoding is coming thru as attachment
« on: July 13, 2018, 12:59:09 PM »
I made a mistake in my encoding variable please ignore.
178
Language / text/html encoding is coming thru as attachment
« on: July 13, 2018, 11:46:00 AM »
I use the *web\email encoding all the time.
I'm working on a client using pxplus 10.2
and when i do a text/html encoding and i create the body of email as standard html it keeps coming thru as an attchment
it happens when i send to my gmail and outlook.
does anyone have any ideas?
thanks
jeff
I'm working on a client using pxplus 10.2
and when i do a text/html encoding and i create the body of email as standard html it keeps coming thru as an attchment
it happens when i send to my gmail and outlook.
does anyone have any ideas?
thanks
jeff